Hi,
I used lwIP to build an embedded HTTP server using the raw API.
When accepting a new connection, I need to allocate quite a big structure to handle all the request parsing, authentification, content generation ...
Since I do not have that much memory, I restricted the number of structures that could be allocated to 3.
What actually happens for now is that when accepting a new connection, if all ressources are already allocated, the connection is aborted.
What I'm looking for is a way to limit the number of established connection (which I'm kinda already doing), but rather by delaying the call to the accept callback.
There is already a queue of pending connections (backlog), an idea would have been to keep the pcbs there till the number of established connection for that listening pcb drop below a certain threshold fixed by the user.
Is there already a way to do so ? I'm doing it wrong ?
Best regards,
Bertrand