[En-Nut-Discussion] NutTcpConnect freeze
szemzo.andras at gmail.com
Tue Jan 5 13:15:02 CET 2010
I have a couple of AVR based modules with GPRS connection. There are a very rare cases ( It can be 3 weeks, or 3 months without a restart)
when NutTcpConnect fails to return. Nut 4.3.3 is the base, there was a commit for such a bug, but that one is before this release.
Becouse it's very rare case, I cannot debug this easily, but in my opinion there must be something happen with the other side, strange network done etc..
and what I seen before the socket will remain in SYN SENT state, and than nothing happens, that thread will be blocked forever.
I don't really know Nut tcp state machine internals, but could't these block come from here?
int NutTcpStateActiveOpenEvent(TCPSOCKET * sock)
* Switch state to SYN_SENT. This will
* transmit a SYN packet.
* Block application.
if(sock->so_state == TCPS_SYN_SENT)
if (sock->so_state != TCPS_ESTABLISHED)
The NutEventWait will block forever. It's safe to add a relative big timeout to event wait? Or there are other ideas?
More information about the En-Nut-Discussion