Method and device for maintaining TCP long connection through intelligent heartbeat

The invention discloses a method and a device for maintaining TCP (Transmission Control Protocol) long connection through intelligent heartbeat. The method comprises the following steps: sending own environment related information to a server; the server calculates the large interval time of heartbe...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: DENG MINHAO
Format: Patent
Sprache:chi ; eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The invention discloses a method and a device for maintaining TCP (Transmission Control Protocol) long connection through intelligent heartbeat. The method comprises the following steps: sending own environment related information to a server; the server calculates the large interval time of heartbeat timing according to the environment related information and recommends the large interval time to the client; the client determines the timeout time of an initial heartbeat timer according to the recommended large interval time of heartbeat timing, sets the timer, and judges whether the timer sends new actual data before timeout; if yes, canceling the current heartbeat timer, and resetting a new timer; if not, judging whether the timer is disconnected before timeout; if yes, whether TCP long connection needs to be reinitiated is determined; if the heartbeat packet is not interrupted and the timeout time of the timer is reached, sending the heartbeat packet to the server, starting a heartbeat reply timer, updatin