lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] One active TCP connection at a time


From: Jeffrey Nichols
Subject: Re: [lwip-users] One active TCP connection at a time
Date: Thu, 31 Oct 2019 15:59:28 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Replying to myself here. This did indeed cause issues.

Calling tcp_close() on the listening pcb inside the tcp_accept callback I occasionally get a deadlock inside tcp_remove_listener(), where the linked list is circular: pcb->next is equal to pcb.

Anyone have any ideas for how to debug/fix this?

Thanks,
Jeff

On 8/25/2019 10:28 AM, Jeffrey Nichols wrote:
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

_______________________________________________
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]