Hi.
I am trying a csharp sample from
http://www.codeproject.com/csharp/socketsincs.asp .
(Sorry I didn't post all the source codes here, please get the codes
from above link if you want to try).
I had some troubles when I started 6 threads (each thread made a
separate connection) and sent messages to same server simultaneously.
Sometimes, not always, the socket looks like ok, but really it is
dead.
I don't why it happens.
If I can't fix this problem, I want to detect if the connection is
dead.
if( m_sock == null || !m_sock.Connected )
return false, that mean the client thinks it IS connected to the
server.
But after I sent the message, the server didn't receive anything.
After that, it will never work again, unless the client reconnects the
server.
I can't disconnect the connection after I sent my message, because I
want to hear the response from the server.
If the client can detect the real connection status, the client can
reconnect to the server when the connection is dead.
How do I detect the real status of a socket?
Frank