AW: [En-Nut-Discussion] Timeout on TCP connect

Oliver Schulz olischulz at web.de
Mon Jun 14 21:27:39 CEST 2004


Hi Michel,

unfortunately there is (currently) no possibility to set a timeout for
NutTcpConnect().

During the connection establishing, Nut/OS tries four times to send an SYN
packet to the peer and waits 2 secs for a response after each transmission.

If Nut/OS receives no response after the retries, NutTcpConnect returns an
error and sets the socket error to ETIMEDOUT.
So we have an implicit timeout of 4 * 2 secs = 8 secs for NutTcpConnect.
You can find the timing in net/tcpsm.c (v 1.9.2.1.2.1), lines 1466 and
folowing.

NutTcpConnect also returns an error if the TCP stack receives RST or FIN
segments from the peer during connection establishing.

Hope that helps,
Oliver.



> -----Ursprüngliche Nachricht-----
> Von: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Michel
> Hendriks
> Gesendet: Montag, 14. Juni 2004 14:32
> An: en-nut-discussion at egnite.de
> Betreff: [En-Nut-Discussion] Timeout on TCP connect
>
>
> Hi,
>
> Is there a way to set a timeout on NutTcpConnect()?
> Looking at the source I see that it returns on a connect or an error.
> What determines these errors? And, more importantly, where is
> the timing for this
> determined?
>
> Greetings,
> Michel
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list