Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

896 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now