?
Solved

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

Posted on 2004-04-20
3
Medium Priority
?
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

800 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