Asynchronous Socket Problem with TCPIP

D

DaTurk

Hi,
Lets see, for arguements sake lets just say that I have a server,
which site waiting to receive connections, it then has an array of
sockets that are connected to it.

It's receiving all of this asynchronously. Now, this is my problem, I
have a seperate application that connects to the server and can
disconnect any of the sockets connected to it. But, lets just say I
have one client connected, and then I attempt to disconnect them via
the seperate application. I close the socket, and remove it from the
array on the server, but then the server receives a message from the
client where their socket is equal to null. Does anyone know how this
is possible?
 
C

Chris Mullins

When your socket closes, any asynchronous operations that happen are
terminated.

This means the callback you passed to BeginReceive will fire, you'll call
"EndReceive", and gracefully handle your shutdown conditions from there.
 

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