From df43a1affc2b09d26cc02057b19310dcfaed1351 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Thu, 14 May 2020 15:18:39 +0800 Subject: [PATCH] add LINGER to menuconfig --- components/lwip/Kconfig | 14 ++++++++++++++ components/lwip/port/esp32/include/lwipopts.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index ffd34c995..dfc2b714d 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -75,6 +75,20 @@ menu "LWIP" will be redirected to lwip_select(), therefore, select can be used for sockets only. + config LWIP_SO_LINGER + bool "Enable SO_LINGER processing" + default n + help + Enabling this option allows SO_LINGER processing. + l_onoff = 1,l_linger can set the timeout. + + If l_linger=0, When a connection is closed, TCP will terminate the connection. + This means that TCP will discard any data packets stored in the socket send buffer + and send an RST to the peer. + + If l_linger!=0,Then closesocket() calls to block the process until + the remaining data packets has been sent or timed out. + config LWIP_SO_REUSE bool "Enable SO_REUSEADDR option" default y diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index eeacbfd29..978857d6a 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -562,6 +562,11 @@ */ #define LWIP_TCP_KEEPALIVE 1 +/** + * LWIP_SO_LINGER==1: Enable SO_LINGER processing. + */ +#define LWIP_SO_LINGER CONFIG_LWIP_SO_LINGER + /** * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. */