Connection status for asynhronous sockets |
|
|
by Viking posted on 2005/10/19 |
|
How to find out connection status if using asynchronous sockets?
I'm trying to avoid the hang on SecureSocket.Receive() when connection is lost.
To get this status for synchronous sockets, one can use Poll + Available before calling Receive. |
by Viking posted on 2005/10/20 |
|
Just to clarify the post above.
I'm hanging on EndReceive() expecting to receive some bytes from the server but they are not coming. After some winsock timeout connection gets broken.
In order to prevent this timeout i'm using Poll+Available to learn the current server status IMMIDIATELY if working with synchronous sockets.
What should I do with asynchronous ones? Is there a way? |
by Neil posted on 2006/01/12 |
|
The call to BeginReceive returns a IAsyncResult, which has a property called IsComplete. This is set to true once the asynchronous operation has completed. |