Solved

How can I know of network failure when using asynchronous Sockets ?

Posted on 2004-04-20
3
228 Views
Last Modified: 2010-04-15
Im writing up a time server which connects with clients asynchronously. I am able to pick up the socket exceptions thrown when client disconnects remotely/by force but when i pull the client network cable out (i.e. event of network failure) how can i kno that the particular client socket is no longer connected? How would I ping the client to find out? I tried sending a message using a timer event but its not throwing any exceptions when i try to send to the diconnected client!

Thanks in advance

0
Comment
Question by:Code_mechanic
3 Comments
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 25 total points
ID: 10891916
I take it from your description that you are using TCP. As I understand it, TCP will keep trying to send your message for a very long time (it is a reliable transport). You may be able to change the timeout for the TCP connection, or you could implement your own timeout (i.e. send keepalive messages, and if you don't get one within a certain period, close the connection).

Zaphod.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question