Click to See Complete Forum and Search --> : problems with recv on n/w cable unplugging


ecostar
October 18th, 2006, 10:16 PM
Hi,
In one of my programs i connect a client to my server and when i disconnect the client system from the network the recv method in the server code still keeps waiting , and when i reconnect it the parent spawns another process to handle the new client connection ( i mean its coded that way ), what i need to know is when i disconnect the client from the n/w will recv ( or read or select for that matter ) never know what happened to the client ?? or is there a better way to handle this situation ??

MikeAThon
October 19th, 2006, 02:49 PM
An unplugged cable is not a network error, so, unless something else happens, recv() will sit there, potentially forever.

You could implement a "keep alive" protocol if this is important to you.

Mike