lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] RE: [lwip-users] Why the tcp_pcb haven't been free when Ica


From: Goldschmidt Simon
Subject: [lwip-devel] RE: [lwip-users] Why the tcp_pcb haven't been free when Icalltcp_close()
Date: Fri, 16 Mar 2007 08:17:18 +0100

Hi,

I have a developer's question about the TCP state machine:
On lwip-users, there was the following post:

> > When I call tcp_close(),the program will send FIN,
> 
> At which point the connection will (or at least should) move 
> from ESTABLISHED to FIN_WAIT1.  
> 
> > and then the
> > receiver will reply FIN
> 
> At which point we'll go through FIN_WAIT2 to TIME_WAIT.
> 
> > But the tcp_pcb haven't been free after this operation.
> 
> It will have to wait to timeout from TIME_WAIT before it is freed.
>...

Why exactly does the pcb go into TIME_WAIT state? From my expirience
with socket programming (I know, that's not reading any standard, only
observing OS behaviour) it would only go there if the _server_ side
closes the connection first. If the _client_ side closes first, it will
be freed right after the server closes it.
I observed it on Windows (that's what I mean, only observing OS
behaviour... :) and an embedded OS (I think it was netOS).
I tried to get an answer to what lwIP is doing in these two cases
through reading the code, but unfortunately, I didn't really get it, I
think...

Does anyone know the answer (or why I saw it like this on the 2 OSes)?


Simon




reply via email to

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