lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Raw TCP API: question about tcp_close and accept callba


From: Sergio R. Caprile
Subject: Re: [lwip-users] Raw TCP API: question about tcp_close and accept callback in
Date: Mon, 1 Oct 2018 09:32:01 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

A TCP server might handle many incoming connection requests, each one of
them will fire the accept callback.
That callback is responsible for acquiring any memory that it would need
for the application, and then will register callbacks for that instance
of the application. There is one instance per connection.
When the connection is closed, memory is freed and callbacks unregistered.

There is one accept callback per port, you listen on a port, which uses
a listening pcb (your calls to tcp_new() and tcp_bind() at init, your
'echo_pcb')
There is one set of callbacks per connection, each connection uses a new
pcb (your 'tpcb'), the listening pcb is always listening for other new
connections.



reply via email to

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