|
From: | Daniel Pauli |
Subject: | Re: [lwip-users] TCP send() fails when other sockets perform retransmissions |
Date: | Fri, 6 Jan 2017 10:54:16 +0100 |
RAW_PCB exhaustion is most likely unrelated to the problem you’re seeing. When TCP segments are allocated in tcp_write() (with TCP_WRITE_FLAG_COPY specified) there are two allocations: PBUF_RAM (coming from LwIP heap, controlled by MEM_SIZE) and struct tcp_seg (coming from MEMP_NUM_TCP_SEG static memory pool)
In order to size these two pools according to what your connections can handle, you can use a worst case calculation where you assume all connections have a full send buffer worth of MSS segments.MEM_SIZE: should be at least MEMP_NUM_TCP_PCB * TCP_SND_BUF with some extra space for miscellaneous heap allocationsMEMP_NUM_TCP_SEG: should be at least MEMP_NUM_TCP_PCB * (TCP_SND_BUF / TCP_MSS)
I haven’t used LWIP_SO_LINGER in my port, but when not enabled, you get the default TCP closure behavior which is a graceful close with a 20 second timeout (see LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT)
What state is the PCB in after closing the listener? That sounds strange that this would pcb would hang around
Joel
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |