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

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

Hi Michel,

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

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, lines 1466 and

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

Hope that helps,

> -----Ursprüngliche Nachricht-----
> Von: en-nut-discussion-bounces at
> [mailto:en-nut-discussion-bounces at]Im Auftrag von Michel
> Hendriks
> Gesendet: Montag, 14. Juni 2004 14:32
> An: en-nut-discussion at
> 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

More information about the En-Nut-Discussion mailing list