[Top][All Lists]

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

Re: [lwip-users] How to set callback for accepted netconn connection?

From: address@hidden
Subject: Re: [lwip-users] How to set callback for accepted netconn connection?
Date: Mon, 22 Nov 2021 08:15:05 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2

Am 19.11.2021 um 22:55 schrieb Grant Edwards:
After accepting a tcp connection with netconn_accept(listenconn,
&newconn), how does one set the callback function for newconn?

The callback gets copied from the listening connection. While it would
probably not be a big problem to change the netconn->callback member at
that point, it's not currently implemented.

However, there would be a race condition: the callback may be called
right after accepting the underlying connection, but before an
application thread has pulled the new connection out of the listener's
acceptmbox. So there might be a time span where the underlying TCP
connection can receive data but you wouldn't have changed the callback yet.

Being like that, we live with having one callback for all types of
connections in the socket layer.


reply via email to

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