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

Re: Receiving Socket Close event in .NET Sockets by Tom

Tom
Mon Apr 21 11:07:29 CDT 2008

On 2008-04-21, Phil <phil78@sbcglobal.net> wrote:
> 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.

--
Tom Shelton