lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Accepting TCP connections when out of PCBs


From: address@hidden
Subject: Re: [lwip-users] Accepting TCP connections when out of PCBs
Date: Tue, 27 Nov 2012 17:27:43 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1

address@hidden wrote
I have a question regarding accepting client PCBs on a listening PCB:

Is it by design that the stack aborts an already connected PCB, if it fails to 
allocate a free TCP PCB from the memory pools to handle pending connection 
requests?

Yes, that's by design. Note that pcbs have a priority (pcb->prio) and only connections that have a lower priority (value) than the newly allocated pcb will be closed.

One could argue though, whether this check should be changed from 'old_prio <= new_prio' to 'old_prio < new_prio'. However, this would break existing applications relying on this behaviour.

How do I protect my existing connections in this 'out of memory' situation?

If you don't want them to get aborted, set the priority higher than the priority of the listening pcb.

I'm using RAW API 1.4.1 with memory pools enabled and backlog disabled.

Hmm... lwIP 1.4.1 has not been 'officially' released, yet. I think I tagged the git repository, though...

Simon



reply via email to

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