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

Harald Kipp harald.kipp at egnite.de
Fri Jun 3 15:39:22 CEST 2005


Hello Gerd,

Depends. If your application has a chance to check
wether the Ethernut is still alive, if may check
it every second and react immediately, if it died.

If you application can make sure, that new data will
arrive, say, every two seconds, then setting a timeout
at 3 seconds and getting a timeout is a good indicator,
that something went wrong.

TCP doesn't provide a standard mechanism to find out,
wether the peer is alive other than sending data to
the peer.

Many stacks provide keepalive, Ethernut doesn't. But
it responds to pings and thus is able to support
keepalive.

Modems add complexity. Without DTR/DCD handshake, it
is difficult to handle disconnects. With Ethernut 2
you may use the RTS/CTS lines for this purpose, because
RTS/CTS handshaking is usually not required.

Harald




More information about the En-Nut-Discussion mailing list