> I use the lwip raw api.
>
>
> When I call tcp_close() the tcp state is ESTABLISH.
> and tcp_close() return err=ERR_OK.
>
> when will the tcp_pcb be free?
I don't really know the lwip raw api regarding TCP. But what I know is
that on socket-based systems, a TCP connection is only closed from one
side if you call close(). It remains in a closing state until the other
side has closed the connection, too.
Without looking in the code, I would say this is the same for lwip raw
api, too. I don't know if there is a function which aborts the
connection without waiting for the other side to close it, too.
Simon