|
From: | Jeffrey Nichols |
Subject: | [lwip-users] One active TCP connection at a time |
Date: | Sun, 25 Aug 2019 10:28:18 -0400 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
Hi,I'm trying to figure out the best way to have only one incoming TCP connection active at a time.
I inherited some code that calls tcp_close() on the listening pcb inside the tcp_accept callback, and creates a new listener later when the active connection is closed. I'm not certain that this is the best way to do this, and suspect there may be edge cases that will be missed. The listener has to set the SOF_REUSEADDR option whenever it gets created to make everything work.
I've been trying to familiarize myself with lwip and looking to see if there's a supported way to achieve this functionality. Some other options that occur to me are using TCP_LISTEN_BACKLOG or calling tcp_abort on all of the new pcbs inside the tcp_accept callback.
Does anyone have any advice for the best way to achieve only one active connection at a time?
Thanks, Jeff
[Prev in Thread] | Current Thread | [Next in Thread] |