This time is free time? Set up in 100 seconds, for example, the 100 seconds, there are many times communication, send a heartbeat, started 100 seconds after the last free again hair, or ignore this 100 seconds to see if there is communication, every 100 seconds to send a heartbeat?
CodePudding user response:
Length of time to see his needs, if is not very important, can lengthen appropriately, because also consumes traffic keep alive, should be the appearance of a few dozen bytes,Keep calculation should be the last time to send and receive time, start time, the timeout is the internal keep alive, keep the heart, if there is no communication, still will timeout kept keep alive, the heart beat,
CodePudding user response:
Actually don't have to struggle this bartender how long live often rightThe need to maintain a long connection, make the client sends a heartbeat packets on a regular basis to the server is solved,