lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Understanding Raw TCP PCB allocations.


From: Luciano Moretti
Subject: [lwip-users] Understanding Raw TCP PCB allocations.
Date: Mon, 26 Apr 2021 14:24:34 -0500

Hello,
I'm trying to make sure I understand what's going on.

Here's my understanding:

When I create a listening connection:
1. I pass a PCB to tcp_listen(). The passed PCB gets deallocated and a new listening PCB is returned.
2. When a client connects to my listening socket the accept callback is called with a NEW session PCB. The listening PCB is still in existence.
3. When I "close" the active TCP connection, I should close the New Session PCB that was allocated in 2.
4. The listening PCB created in step 1 is still listening and will accept any new connections.
5. When I want to stop listening, I need to call tcp_close() on the listening PCB allocated by tcp_listen() in 1.

So I'm going to have to manage both the listening PCB and an active connection PCB for a "listening" socket? 

Thanks,
Luciano



reply via email to

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