Click to See Complete Forum and Search --> : How do I know if a connection is still connectd?


allomeen
February 27th, 2006, 03:48 PM
Hello,
Is there any way in C++ to find if a tcp connection is still connected or lost connection.

I'm trying to do something like this:

if(is still connected)
{
//code...
}

Thanks,
Alaa
allomeen is online now Edit/Delete Message

souldog
February 28th, 2006, 03:02 AM
In general you don't.

You may not always get a "notification" when a connection fails.

If the connection has been lost, then when you try and use it, it will fail.
That is how you know.