hello, is it possibleto check the state of a socket.
To check whether the soccket ist listening or connectet or in the worse case corrupt/closed ?

GREETS GB-BBB
Posted on 2003-07-29 02:46:47 by Bubu-Boy

hello, is it possibleto check the state of a socket.
To check whether the soccket ist listening or connectet or in the worse case corrupt/closed ?

GREETS GB-BBB


select function will give you some of answers but not all of them.
It won't tell you if you initiated the connection by connect or listen+accept but I guess you know that yourself(!?).
It will tell if it's killed ungracefully by returning a error code. If you get a read event and recv() returns zero bytes read then the connection is closed gracefully.

// CyberHeg
Posted on 2003-07-30 02:46:28 by CyberHeg