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: Sylvain Rochet
Subject: Re: [lwip-users] LWIP raw TCP socket disconnection
Date: Mon, 8 Feb 2016 23:06:05 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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