[En-Nut-Discussion] TCP/HTTP problem

Wojciech Nizinski niziak at spox.org
Thu Jul 11 11:38:50 CEST 2013




In article <24E383FC1C8DCF48ACAB94CA2BAE7A29281BB774
@exchbox01.ccsi.local>, you say...
> 
> Hi all,
> 
> We made a product with AT91_SAM7X256 and Nut/OS 4.8.7. Recently we found a problem with accessing the webpage via Internet. We can replicate the issue with one IP router (we use port forwarding from port 80 to 80). The webpage becomes inaccessible for a while but then returns to the working condition after about a minute. In the inaccessible state, the webpage is not reachable via both the LAN side &the WAN side but pings work. We watch the messages with Wireshark 
during the test. We see TCP RST sent by our product (Nut/OS) during the inaccessible state. 
> 
> Did anyone see this problem before? Is there a solution for this problem?
> 
Probably all server threads are busy (very popular case when you are 
accessing your device remotely from slow networks, i.e. from mobile 
phone).

Please try to set low socket timeouts, i.e. 5 seconds:

        #define HTTP_SOCKET_TIMEOUT     5000
        ...
        u_long tmo = HTTP_SOCKET_TIMEOUT;
        ...
        NutTcpAccept    (sock, 80);
        NutTcpSetSockOpt(sock, SO_RCVTIMEO, &tmo, sizeof(tmo));
        NutTcpSetSockOpt(sock, SO_SNDTIMEO, &tmo, sizeof(tmo));




More information about the En-Nut-Discussion mailing list