Bill Auerbach wrote:
This means tcp_listen_with_backlog can be used to enforce only one
connection?
Exactly. That's what the backlog parameter in posix listen() does, also.

If this backlog limit is exceeded, what happens?
Incoming connections will be sent a RST. However, this doesn't limit
concurrent connections by default: it has been introduced to limit the
outstanding-connection-queue for netconn- or socket-API. Normally, for
the raw API, there is no such thing (that lies in the nature of the
single-threaded callback mechanism). However, when using this feature,
you have to call tcp_accepted from your appect function to decrease this
counter. If you defer calling tcp_accepted and call it later, you can
implement a concurrent-connection limitation.

When using the socket- or netconn-API, the stack does this for you.
Suppose you have one thread calling accept/recv/send/close in a loop and
set the backlog to 1 then you will only have one active and one pending
connection at a time and all other SYNs coming in will be RST'ed.

Simon



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to