lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP raw TCP socket disconnection


From: Joel Cunningham
Subject: Re: [lwip-users] LWIP raw TCP socket disconnection
Date: Mon, 08 Feb 2016 22:29:06 +0000 (GMT)

Here's a great article on everything you'd ever want to know about handling half-open TCP connections:

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

I make sure to keep this book marked :D

Joel

On Feb 08, 2016, at 04:06 PM, Sylvain Rochet <address@hidden> wrote:

Hi Frédéric,

On Mon, Feb 08, 2016 at 12:52:43PM +0000, Frédéric Grandjean wrote:
Hi,
I'm using LWIP 1.4.1 and I'm facing an issue with "brutal" raw socket disconnection.

Imagine the following scenario:

- Create a TCP_PCB listener (server)

- On connection from a remote host (a Windows PC), accept it, with all callbacks

- Now, I remove the Ethernet cable from my application

- I also exit (brutally) the remote client application

- Now, I wait 1 minutes and connect back the Ethernet cable

- LWIP never signals the connection is lost, not the state of the PCB tells me (Still ESTABLISHED)!


How to detect this kind of disconnection ?

TCP keepalive is your friend here (LWIP_TCP_KEEPALIVE).

Other solutions usually chosen are server side timeout (e.g. HTTP) or an
application level ping/pong protocol (e.g. IRC).

Sylvain
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: signature.asc
Description: PGP signature


reply via email to

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