Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

14 Experts available now in Live!

Get 1:1 Help Now