|
From: | address@hidden |
Subject: | Re: [lwip-users] Freeing all pbufs on tcp_abort() |
Date: | Tue, 01 Sep 2009 17:45:36 +0200 |
User-agent: | Thunderbird 2.0.0.23 (Macintosh/20090812) |
JM wrote:
What is the proper way to close a connection and free all resources, namely pbufs, associated with it? In my application, I have to use tcp_abort to end the connection. (I do indeed have to send a RST; Winamp does the same thing with streaming audio and I'm emulating that). I can connect to to a host and receive data fine, but when I end that connection and initiate a different connection, my debug output occasionally indicates I'm out of MEMP_POOL."Out of MEMP_POOL" can mean anything. You need to know exactly which pool and see if it is really the pbufs you are running out of. But I'd rather guess it's the tcp_pcb-pool: aborted pcbs are put on the time-wait list. If you then open a new connection, you will eventually run out of tcp_pcbs. However, that's not a fatal warning as the tcp code then frees the oldest pcb in time-wait and uses it. You should check the stats (or use the prin_stats function) to see which memp pool was emtpy.
Simon
[Prev in Thread] | Current Thread | [Next in Thread] |