|
|
@ -1698,9 +1698,9 @@ void CliAuConn::AutoPing () { |
|
|
|
void CliAuConn::StopAutoPing () { |
|
|
|
void CliAuConn::StopAutoPing () { |
|
|
|
critsect.Enter(); |
|
|
|
critsect.Enter(); |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (AsyncTimer * timer = pingTimer) { |
|
|
|
if (pingTimer) { |
|
|
|
|
|
|
|
AsyncTimerDeleteCallback(pingTimer, CliAuConnTimerDestroyed); |
|
|
|
pingTimer = nil; |
|
|
|
pingTimer = nil; |
|
|
|
AsyncTimerDeleteCallback(timer, CliAuConnTimerDestroyed); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
critsect.Leave(); |
|
|
|
critsect.Leave(); |
|
|
@ -1708,17 +1708,6 @@ void CliAuConn::StopAutoPing () { |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void CliAuConn::TimerPing () { |
|
|
|
void CliAuConn::TimerPing () { |
|
|
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
|
|
|
|
// if the time difference between when we last sent a ping and when we last
|
|
|
|
|
|
|
|
// heard from the server is >= 3x the ping interval, the socket is stale.
|
|
|
|
|
|
|
|
if (pingSendTimeMs && abs(int(pingSendTimeMs - lastHeardTimeMs)) >= kPingTimeoutMs) { |
|
|
|
|
|
|
|
// ping timed out, disconnect the socket
|
|
|
|
|
|
|
|
AsyncSocketDisconnect(sock, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Send a ping request
|
|
|
|
// Send a ping request
|
|
|
|
pingSendTimeMs = GetNonZeroTimeMs(); |
|
|
|
pingSendTimeMs = GetNonZeroTimeMs(); |
|
|
|
|
|
|
|
|
|
|
@ -1732,7 +1721,6 @@ void CliAuConn::TimerPing () { |
|
|
|
|
|
|
|
|
|
|
|
Send(msg, arrsize(msg)); |
|
|
|
Send(msg, arrsize(msg)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
void CliAuConn::Send (const uintptr_t fields[], unsigned count) { |
|
|
|
void CliAuConn::Send (const uintptr_t fields[], unsigned count) { |
|
|
|