Hi there...
The Connected property will return the latest known state of the Socket.
There's no way the server detects a client has gone offline... unless you
program it. A couple of months ago I had to develop this app (based on
TCP/IP) and I had the same question as you do. My solution was to implement
some sort of "keep alive" message send from the server to the client in a
time based frequency (it's a parameter in my app's config file). I suppose
that you had to define the protocol that is gonna be used throughout your
application, well consider having this "pinging" message. It's worked
excellent to me.
As a matter of fact, if you issue the netstat command at the prompt having
the client disconnected you still see "the connection" it's a funny thing
but it's true. Have a nice day.
Hope this might help you,
Regards,
--
Angel J. Hernández M.
MCSD
"Jason Hurder" <jhurder@spam_me_not.fastpicsystems.com> escribió en el
mensaje news:Oy**************@TK2MSFTNGP10.phx.gbl...
Hi folks,
I am writing a small network application that uses TCP sockets. My
application is the accepts connections via the AcceptConnection function
of a server socket and creates a client socket from it. My question is, if
someone disconnects from my server, how can I detect this? Checking the
Connected property of the System.Net.Socket object does not seem to solve
the problem. Thank you!
Jason