lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How do I handle the ETHERNET cable unplug/replug on the


From: Indan Zupancic
Subject: Re: [lwip-users] How do I handle the ETHERNET cable unplug/replug on the server side using LWIP in a correct way?
Date: Wed, 31 Aug 2022 12:42:29 +0200
User-agent: Roundcube Webmail/1.3.16

Hello Hensel,

On 2022-08-31 11:44, Hensel, Christian wrote:
Meaning only one sock_connection is allowed to be served at any time

You probably don't want this for TCP, because of TIME_WAIT and long
time-outs before client is considered to be gone.

If the server ever closes the socket it will go into TIME_WAIT state
and keep the socket around for a bit till it's sure the connection is
closed. During that time, no new clients can connect if you only have
one TCP socket.

On the second connection attempt of the client lwip_select will be
executed but returns -1.
And the client gets a TCP connection timeout.

Because the previous connection is still open and you told lwIP it
can't have any more.

How long will LWIP wait until the next sock_connection can be
successfully established?

Forever if the server doesn't send any data and keep-alive is disabled.

Which parameters need to be set to decrease this time?
Are there any other parameters to be set to get this working?

Enable keep alive, max segment lifetime, number of retries, etc.

TCP is designed to recover from temporary network disconnects,
so existing connections should keep working when the cable is
reconnected.

If you know for sure that this is not what you want, you could
also abort all TCP connections when interface goes down. However,
this doesn't solve the problem for suddenly disappearing clients,
and once you solved that, manual aborting open connections is not
needed.

CLASSIFIED: CONFIDENTIAL

I hope not, this is a public mailing list.

Greetings,

Indan



reply via email to

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