Receiving Socket Close event in .NET Sockets

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

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
 
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.
 
Back
Top