[En-Nut-Discussion] How do we use TCP Socket timeout to detect a dead connection?

Lost Jedi lostjedi32 at yahoo.com
Thu Jul 8 14:26:30 CEST 2010


If using NutTcpSetSockOpt to set receive timeout, for eg:

   u_long rx_to = 10000;

   NutTcpSetSockOpt(sock, SO_RCVTIMEO, &rx_to, sizeof(rx_to));

All it does is flush the buffer/dump the data - a blank - after the timeout, much like the way the serial port timeout works.

How does one actually detect the dead connection? (apart from using some form of keep-alive mechanism)


      




More information about the En-Nut-Discussion mailing list