
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
64
8.2 Heartbeat Packet
The heartbeat packet is mainly used to detect whether the communication link is
disconnected. The approach is to send a heartbeat packet data to the server software
every once in a while, which is discarded by the server after receiving and will not be
used as an effective communication data.
The heartbeat package has two main functions: first, it can let the upper computer
software know that the device is in active state; Secondly, if the device fails to send the
heartbeat, the device in the TCP client will automatically re-establish the TCP connection,
so it is a means to restore network communication.
Figure 54 Keep Alive Time
As shown in figure 54, the sending time of heartbeat packet is set by "Keep Alive Time".
8.2.1 Implied Heartbeat
Even if you don't set up any heartbeat packets, the ZLAN device will enable the
hidden heartbeat function when it is in the TCP client. So the implied heartbeat
function is the device sending data, but the server actually does not receive the
heartbeat data. So it can't achieve the first function of the heartbeat packet, that is,
the function of whether the server detects the activity or not; But because actually
the device has sent data, it can achieve the second function of heartbeat packets,
that is the function of the device detecting whether the TCP connection is normal,
once detecting the disconnection it still can automatically establish a TCP
connection.