1. A device sends a ping packet to the server every 60 seconds. If no pong response is received within 42 seconds, the device sends an RST packet to terminate the TCP connection, and the offline reason is displayed as Closed. The ping pong communication is used to test whether the TCP connection is terminated.
2. The server checks each device connection every 75 seconds. If the ping pong connection is normal or the server receives data reported by any device within the heartbeat period, the TCP connection is determined as normal. If no data is received from a device in two detection cycles, the device is determined as offline.