Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TcpClient get connection status

Status
Not open for further replies.

FurqanAhmed

Programmer
Oct 1, 2001
87
PK
Hi Guys

I am developing client/Server Socket Application using TcpClient and TcpListner.

i just wants to know, if the connection breaks accedently then how can i get know at TcpClient site that the connection has been broken.

plz give me the idea with code.

Thank You
Best Regards

YEH GHAZI YEH TERAY PUR-ASRAR BANDAY
 
Typically, you would send all your communications through a single class that contains some kind of retry logic.

If after a few attempts, the connection still appears to be broken, have the class fire an event to indicate the connection has been lost.

I know some people also send out some kind of ping to the service you are connecting to every few seconds but keep in mind that this can cause unwanted bandwidth consumption if there are a lot of clients.

I'm not sure if there is a TCP connection utility that will check the connection status for you. I think that may be something they are introducing in VS 2k5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top