Sebastien Lorquet firstname.lastname@example.org [nuttx]
2018-01-24 14:48:32 UTC
We have a nuttx board connected via IP to a management station, It behaves as a
client, connect() ing to the board.
The management station opens a connection with the board(s). The connection
stays open so the board can report real time events.
We want to manage the connection life cycle properly.
If we close the socket on the management station everything is of course ok.
If we disconnect the cable from the board, the PHY detects the link down and
closes the socket. This is also OK.
However, if we disconnect the network link by disconnecting a remote cable
(imagine a chain of switches), then the board does not detect the disconnection
and remains blocked in read() on the opened socket.
We have only allowed one simultaneous connection so we are stuck. Allowing more
connections, and killing the previous thread when accepting a second connection
is not a clean solution, even if it is a possible workaround.
So we are not able to detect a network disconnection properly.
We have found that we need SO_KEEPALIVE to have regular link test packet
exchanged between the server and the board.
Does someone have plans to implement such a feature?