Solved

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

Posted on 2004-04-20
3
226 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

775 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