How do you recognize a Socket Close event in .NET. From what I have read on
the internet, it is done by checking if the byte count is zero in the
EndReceive() callback function in an Asynchronous type of connection. What I
can't seem to find out is how you do this if you are using a Synchronous
connection. Does anyone know how this is done?
Thanks,
Phil
Tom Shelton - 21 Apr 2008 17:07 GMT
> How do you recognize a Socket Close event in .NET. From what I have read on
> the internet, it is done by checking if the byte count is zero in the
> EndReceive() callback function in an Asynchronous type of connection. What I
> can't seem to find out is how you do this if you are using a Synchronous
> connection. Does anyone know how this is done?
A synchronous receive returns 0 if the socket has been closed.

Signature
Tom Shelton