Receiving Socket Close event in .NET Sockets

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
 
T

Tom Shelton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top