lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Best way for determining if a TCP connection is dead?


From: address@hidden
Subject: Re: [lwip-users] Best way for determining if a TCP connection is dead?
Date: Wed, 24 Jan 2018 20:29:04 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 24.01.2018 18:16, Joel Cunningham wrote:
On 01/24/2018 10:35 AM, Chris Seto wrote:
I have some code which works great, based on the echo client example.

I'm working on hardening it, and I'm wondering with how best to deal with a dead TCP connection as a result of the network link being down (ie, Ethernet cable disconnected).

This is a great source for dealing with half-open TCP connections due to all kinds of conditions:

https://www.codeproject.com/Articles/37490/Detection-of-Half-Open-Dropped-TCP-IP-Socket-Conne

To sum it up, you need to send packets over your TCP connection. The 
preferred method is to write your application protocol in such way. Only 
if this is not an option (e.g. existing protocol without such a feature, 
backwards compatibility, etc.), you could use the tcp keepalive feature. 
This is *not* encouraged though! Unfortunately, a keepalive probe coming 
through does *not* necessarily/always mean data can flow.

Simon

reply via email to

[Prev in Thread] Current Thread [Next in Thread]