lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Problem re-opening listening pbc


From: Keith Rubow
Subject: Re: [lwip-users] Problem re-opening listening pbc
Date: Fri, 11 May 2018 15:44:24 -0700
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

I tried the backlog feature (not very well documented). I put #define TCP_LISTEN_BACKLOG 1 in my lwipopts.h file. I changed tcp_listen() to tcp_listen_with_backlog(), passing it the maximum number of simultaneous connection I want. I added tcp_backlog_delayed() to my accept callback. I added tcp_backlog_accepted() before tcp_close() when the connection was closed in either the receive data callback (with p=NULL), or when my application times out the connection.

This does limit the number of connections that can be opened simultaneously. However, once the limit is reached, additional connection attempts are not refused (which is what I would prefer), rather the connection attempts simply time out. Still, this might be better than my initial approach of aborting additional unwanted connections, which resulted in the connection opening, but immediately closing again.

Still, the question remains why lwip will not allow binding to a port number that has no current listening pcb, but does have one or more open connections. I don't understand why this would cause a problem.

Keith Rubow

On 5/11/2018 5:51 AM, Sergio R. Caprile wrote:
Check this answer:
http://lists.nongnu.org/archive/html/lwip-users/2016-08/msg00093.html

I guess your option is to play with the backlog


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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