detecting dropped client socket connections

From: Rajpaul Bagga (rajpaul@hp866a.lanl.gov)
Date: Wed Jan 06 1999 - 01:21:46 MET


Hello all.
I'm trying to develop a network server/client setup where the server
periodically checks for messages from the client.  The socket is set for
non-blockin i/o so that when it tries to receive a message if nothing is
there it can go on to do other things.

The problem occurs when the client drops the connection.  I need to assume
that it will not always send a nice message requesting to drop the
connection.  After the client has dropped a connection, if I issues a
socket->Recv() command, I get a SIGSEGV signal.  Is there someway to
detect whether the client has dropped the connection before trying to
receive a message?

Thanks,
-Rajpaul

------------------------------------------------------------------
Rajpaul Bagga			    email: rajpaul@hp866a.lanl.gov
P-25, M.S. H846			    phone: (505) 665-8568
Los Alamos National Laboratory
Los Alamos, NM 87545



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:27 MET