Detecting when a client socket has closed?
I''ve succesfully coded up a system that uses select() to check for data on a socket and then recv() on that socket. Problem is, data isn''t what select() checks for; it''s "readability". A closed socket is defined as readable, since a call to recv on that socket is guaranteed not to block (it''ll return immediately with 0). So is there any special function to check for a closed socket, or a flag in select()? Or do I just add a check for when recv returns 0? Are there any other conditions where recv can return 0 but the socket hasn''t closed?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement