[En-Nut-Discussion] Best way to set timeout for tcp sessions

Gerd Mueller gmueller at netways.de
Fri Jun 3 11:55:51 CEST 2005


Hi list,

I'm using the sample rs232.c to connect to a modem via ethernet. That
works perfectly. But i case the client dies I cannot reconnect to the
ethernut anymore. The session is still up. I found this little code
inside the documentation:

unsigned long to = 1000; /* millisecs */
NutTcpSetSockOpt(sock, SO_RCVTIMEO, &to, sizeof(to));

But is it really a good idea to set the timeout to 1s? Would it be
better to set it to 5min?

Thank you 

Gerd 



More information about the En-Nut-Discussion mailing list