[Top][All Lists]

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

Re: [lwip-users] Closing tcp-Connection

From: Markus
Subject: Re: [lwip-users] Closing tcp-Connection
Date: Tue, 21 Oct 2014 20:40:25 +0200



thanks for the feedback.


I was not aware that there Is something happening after the connection is closed.


So the correct way for closing the connection is

-          Calling tcp_close ()

-          If successful, remove callbacks and

-          Set the pointer to the pcb to zero to avoid socket reuse


Thanks again for the help.







Von: address@hidden [mailto:address@hidden Im Auftrag von Sergio R. Caprile
Gesendet: Montag, 20.
Oktober 2014 17:53
An: address@hidden
Betreff: Re: [lwip-users] Closing tcp-Connection


In other words, do another call to tcp_new() when you want to reconnect
from tcp_close() in tcp.c:

 * Connection pcbs are freed if not yet connected and may not be referenced
 * any more. If a connection is established (at least SYN received or in
 * a closing state), the connection is closed, and put in a closing state.
 * The pcb is then automatically freed in tcp_slowtmr(). It is therefore
 * unsafe to reference it (unless an error is returned).


reply via email to

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