During this period, the socket connection cannot be detected and exited due to network disconnection or long connection time.
Technical Background: the target machine runs on vxworks, while the pc can connect to the target board through serial port and telnet. After the pc connects to vxworks through telnet, execute the shell program we have written, here we call this shell program CLI. Because the telnet client is already writable, microsoft's cmd-> telnet command is generally used, while the telnet server is encapsulated in vxworks by the system and only provides one hook interface function, hook our own function to handle telnet connection and exit. In this hook function, the system only gives socketfd, sessionid, and connection status. When the telnet window is closed, or run the exit command to exit, the system will give the connection status to the mounted function, and unplug the network cable. After some time, telnet will automatically exit, the system does not give the connection status to the hook function, so that the server resources cannot be released in time. Originally, the ioctl function provided a mechanism for sending keepalive packets to check whether the network is valid. However, it seems that this mechanism is not applicable to network disconnection. The specific processing method is to implement a timeout mechanism, if no data is exchanged for all connections within a fixed period of time, the server will disconnect the connection. If more connections detect data, the connection timeout value will be set to 0, if there is no data exchange, the connection is closed after the time is accumulated.