Re: [lwip-users] Closing tcp-Connection

2014-10-20 Thread Sergio R. Caprile
Now I understand.
You are reusing a socket.
After a TCP socket is closed, data can still be going around and the
default behaviour is to wait for a while before reusing that socket.
The raw API does not use sockets, but the behaviour is the same. The
waiting time varies from full hosts to embedded machines, I've seen from
4 minutes to 4 seconds.

I don't know if there is any workaround to this, you surely will be able
to shorten this time if you can't wait, and maybe Simon or any other
might lead to a compile option to provide a workaround if there is one;
the default is to wait or design for an extra socket.



___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] Closing tcp-Connection

2014-10-20 Thread Sergio R. Caprile
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
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users