socket programming related.

Discussion in 'Python' started by hari.siri74@gmail.com, Jul 12, 2007.

  1. Guest

    I have just started working in network programming using python.
    written code for socket connection between client and server. Client
    sent data to server for server processing (also server echoing back
    rcvd data to client). When there is ("if no data": break ) no data
    from client then the while loops break in server. The server program
    process recvd data and my requirement is to send back the *results* to
    client program for user sake. I did many trials but no use, as these
    socket calls are blocking, i could not make my req.
     
    , Jul 12, 2007
    #1
    1. Advertisements

  2. Guest

    On Jul 11, 7:32 pm, wrote:
    > I have just started working in network programming using python.
    > written code for socket connection between client and server. Client
    > sent data to server for server processing (also server echoing back
    > rcvd data to client). When there is ("if no data": break ) no data
    > from client then the while loops break in server. The server program
    > process recvd data and my requirement is to send back the *results* to
    > client program for user sake. I did many trials but no use, as these
    > socket calls are blocking, i could not make my req.


    I just need to add a line. The while loop in server breaks when the
    sockObj.close() happens in client program indicating there is no data
    from client.
     
    , Jul 12, 2007
    #2
    1. Advertisements

  3. On Jul 12, 2:35 am, wrote:
    > On Jul 11, 7:32 pm, wrote:
    >
    > > I have just started working in network programming using python.
    > > written code for socket connection between client and server. Client
    > > sent data to server for server processing (also server echoing back
    > > rcvd data to client). When there is ("if no data": break ) no data
    > > from client then the while loops break in server. The server program
    > > process recvd data and my requirement is to send back the *results* to
    > > client program for user sake. I did many trials but no use, as these
    > > socket calls are blocking, i could not make my req.

    >
    > I just need to add a line. The while loop in server breaks when the
    > sockObj.close() happens in client program indicating there is no data
    > from client.


    Well, you shouldn't do a close() on the client socket, you should do a
    shutdown(1).
     
    Simon Percivall, Jul 12, 2007
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. elearning
    Replies:
    0
    Views:
    420
    elearning
    Apr 1, 2006
  2. Maxwell Hammer
    Replies:
    7
    Views:
    824
    Peter Hansen
    Jun 18, 2005
  3. john
    Replies:
    19
    Views:
    741
    John Ersatznom
    Jan 6, 2007
  4. ferbar
    Replies:
    3
    Views:
    843
    Dave Thompson
    Jun 27, 2005
  5. Gaijinco
    Replies:
    8
    Views:
    472
    benben
    Feb 7, 2006
  6. Laszlo Nagy
    Replies:
    1
    Views:
    7,121
    Mark Wooding
    Jan 27, 2009
  7. Steve Holden
    Replies:
    1
    Views:
    986
  8. elca
    Replies:
    0
    Views:
    307
Loading...