[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] How do I handle the ETHERNET cable unplug/replug on the ser
From: |
Hensel, Christian |
Subject: |
[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 09:44:52 +0000 |
Hi there,
thanks for the information. I will try to narrow my question down to one point.
Let's assume the LWIP settings at the server are:
MEMP_NUM_UDP_PCB = 1
MEMP_NUM_TCP_PCB = 1
Meaning only one sock_connection is allowed to be served at any time
The code snipplet is
for(;;)
{
//
sock_connection = lwip_accept();
// will time out after 5 sec
lwip_select(sock_connection);
// read and handle is not shown here
//
lwip_shutdown(sock_connection, SHUT_RDWR);
lwip_closesocket(sock_connection);
}
The first connection attempt of the client is successful, so sock_connection is
1
While in lwip_select the (physical cable) connection gets lost and no FIN or
ACK is received by the server.
On the second connection attempt of the client lwip_select will be executed but
returns -1.
And the client gets a TCP connection timeout.
How long will LWIP wait until the next sock_connection can be successfully
established?
Which parameters need to be set to decrease this time?
Are there any other parameters to be set to get this working?
Thank You!
CLASSIFIED: CONFIDENTIAL
Christian Hensel
Project Engineer Software Development
PHONE +49 351 2637616
EMAIL Hensel.Christian@vonardenne.biz
VON ARDENNE GmbH
GESCHÄFTSFÜHRUNG/EXECUTIVE MANAGEMENT Pia von Ardenne | SITZ/REGISTERED OFFICE
Am Hahnweg 8, 01328 Dresden, Germany
AMTSGERICHT/DISTRICT COURT Dresden | HRB/REGISTERED NUMBER 38159 | Ust.
ID-Nr./VAT ID DE 140 132 976
PHONE +49 351 2637 300, FAX +49 351 2637 308
office@vonardenne.biz
www.vonardenne.biz