[En-Nut-Discussion] TCP listening socket problems

Trevor O'Grady togrady at comtech.uk.com
Sat Jan 3 01:34:33 CET 2004


This problem also occurs with the Nut\app\rs232d example. Interestingly, if
you omit the flush after sending data to the socket ( either with NutTcpSend
or stream write function) the socket stays open, but  does not send anything
of course. If I enable NUTDEBUG and turn on the TCP debug trace, the socket
always disconnects as soon as it gets connected.
I have a fast approaching deadline for a a project that requires a listening
socket that stays open so any help would be greatly appreciated.

I can provide ethereal files showing the ethernut sending the FIN and TCP
NUTDEBUG traces if required.

Regards
Trevor

>----- Original Message -----
>From: Trevor O'Grady

>Will a TCP listening socket have a timeout ? I'm getting some unexpected
closures of listening sockets especially when connecting to the server after
the first connection.
>The close always occurs after receiving something which makes me suspect
this is not a timeout issue. I detect the socket closing by NutTcpReceive
returning -1. If I then call >NutTcpError on the socket I just get 10057
(ENOTCONN        10057   //!< Socket is not connected ).
>I was initially using streams instead of the NutTcp functions but
experienced similar problems.





More information about the En-Nut-Discussion mailing list