469,890 Members | 1,978 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

How to test if a socket is connected

socket.Connected only gives the last access result but not the current
status of the socket.

What is the best way to determine if a socket is still connected?
Because I want to cancel all my "output" in the client if the socket is
not connected.

What is the best way to determine if a socket is still active on the
server side? When I close my server clients will still do their jobs
and I don't want that to happen.

Thanks for any reply,
Nuno Magalhaes.

Nov 17 '05 #1
2 5944
You can always try to receive or send something, in 'try' block. No
matter what happend - .connected property is filled, right after.
Then only catch an exception and you are home.
PK
Nov 17 '05 #2
You can always try to receive or send something, in 'try' block. No
matter what will happen - .connected property will be filled, right after.
Then only catch an exception and you are home.
PK
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by DreJoh | last post: by
3 posts views Thread by Robert A. van Ginkel | last post: by
5 posts views Thread by Morten | last post: by
5 posts views Thread by John Sheppard | last post: by
2 posts views Thread by Droopy | last post: by
7 posts views Thread by semedao | last post: by
2 posts views Thread by darthghandi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.