[En-Nut-Discussion] NutTcpConnect freeze
Ole Reinhardt
ole.reinhardt at embedded-it.de
Fri Oct 1 13:48:17 CEST 2010
Hi Andras,
while searching for a problem in NutTcpConnect() I stumbled over your
following message to the Ethernut Mailing list.
I have exact the same problem with Nut/OS 4.9.8 running on a ethernut
3.1 board. But it does not take much more than 10 connect retries (with
a not connected network cable) to raise this condition.
Did you found a solution in the meantime?
Regards,
Ole Reinhardt
> 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.
> */
> NutTcpStateChange(sock, TCPS_SYN_SENT);
>
> /*
> * Block application.
> */
> if(sock->so_state == TCPS_SYN_SENT)
> NutEventWait(&sock->so_ac_tq, 0);
>
> if (sock->so_state != TCPS_ESTABLISHED)
> return -1;
>
> return 0;
> }
>
>
> The NutEventWait will block forever. It's safe to add a relative big timeout to event wait? Or there are other ideas?
>
>
> Best Regards,
> Andras
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
--
Thermotemp GmbH, Embedded-IT
Embedded Hard-/ Software and Open Source Development,
Integration and Consulting
http://www.embedded-it.de
Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen -
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97
Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280
More information about the En-Nut-Discussion
mailing list