lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Leaking tcp_ucbs in raw api


From: Steinberg Michael
Subject: [lwip-users] Leaking tcp_ucbs in raw api
Date: Tue, 29 Aug 2017 09:57:21 +0000

Hi all,

After a rather long  timeout with lwip I'm trying to get tcp working on top of 
the raw api. I'm currently experiencing leaking tcp_ucbs that I cannot find a 
solution for.
There are two cases where I call tcp_close on tcp pcbs:

a) Inside the receive callback if the passed pbuf pointer is NULL: connection 
pcb
b) Inside a successful accept callback: listening pcb.

As you can see I'm trying to have at most one active TCP connection at any 
point in time.
What happens when I call tcp_close is that the pcb's flags receive TF_CLOSED. 
But they are subsequently never actually freed internally inside lwip and after 
a few connections I'm running out of tcp pcbs. Looking at tcpip_input it seems 
to me that I would actually need to receive a message on a flagged-closed 
tcp_ucb for the chance of being freed. But this does not happen in my case.

I'm running on version STABLE-2.0.2. Can anybody help me sort this out? How do 
I really have to close tcp_ucbs so they really get freed rather than flagged as 
closed only? 

Kind regards, Michael




reply via email to

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