S
Steve Ricketts
I'm using asynchronous TCP sockets in a C# client application which is
trying to match an old VB6 program behavior. When the server starts to
close (also written in VB6 using winsock) it sends an "EX" code to all the
connected clients telling them to close and then closes all the client
winsock connections. In VB, the client received the "EX" command and began
the shutdown process. However, in the C# program I immediately get 0 length
data from the server like it's closed the connection before sending the
"EX"... I never see the "EX". There is a very small amount of time between
sending the "EX" and closing the socket, but I'm curious what exactly is
happening. I would like to be able to distinguish between a normal shutdown
(receiving the "EX") and simply loosing the connection. Without the "EX" I
don't know whether to try and reconnect or if I was supposed to shut down.
Can anyone give me a brief explanation of what is happing?
Thanks,
Steve
trying to match an old VB6 program behavior. When the server starts to
close (also written in VB6 using winsock) it sends an "EX" code to all the
connected clients telling them to close and then closes all the client
winsock connections. In VB, the client received the "EX" command and began
the shutdown process. However, in the C# program I immediately get 0 length
data from the server like it's closed the connection before sending the
"EX"... I never see the "EX". There is a very small amount of time between
sending the "EX" and closing the socket, but I'm curious what exactly is
happening. I would like to be able to distinguish between a normal shutdown
(receiving the "EX") and simply loosing the connection. Without the "EX" I
don't know whether to try and reconnect or if I was supposed to shut down.
Can anyone give me a brief explanation of what is happing?
Thanks,
Steve