CodePudding user response:
Often hear people say the heart mechanism, regularly send a packet to reply to confirm again, if received several times that connection has been disconnected, reconnect,CodePudding user response:
Is clientsocket controls? Controls for attribute set, if the API, seems there is no automatic disconnect the provisions of the so-called automatic turnoff, more may be intermediate nodes (such as switches, firewall) as zombies connect and disconnect, if you want to solve the problem of automatically disconnect, just get a regular brush sense data sent heartbeat, switch won't disconnect your connection, as for automatic reconnection, that is about to heart + confirm, don't get reply reconnection,