Hallo,

 

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.

 

Regards

 

Markus

 

 

Von: [email protected]
[mailto:[email protected]] Im Auftrag von Sergio R.
Caprile
Gesendet: Montag, 20. Oktober 2014 17:53
An: [email protected]
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).

 

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to