Skip to content

Commit e58efd0

Browse files
committed
add comment for ClientAliveTracker class
1 parent 892944d commit e58efd0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

vpr/src/server/gateio.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ class GateIO
4949

5050
const std::size_t CHUNK_MAX_BYTES_NUM = 2*1024*1024; // 2Mb
5151

52-
class ClientAliveTracker {
52+
/**
53+
* @brief Helper class aimed to help detecting a client offline.
54+
*
55+
* The ClientAliveTracker is pinged each time there is some activity from the client side.
56+
* When the client doesn't show activity for a certain amount of time, the ClientAliveTracker generates
57+
* an event for sending an ECHO telegram to the client.
58+
* If, after sending the ECHO telegram, the client does not respond with an ECHO, it means the client is absent,
59+
* and it's time to start accepting new client connections in GateIO.
60+
*/
61+
class ClientAliveTracker {
5362
public:
5463
ClientAliveTracker(const std::chrono::milliseconds& echoIntervalMs, const std::chrono::milliseconds& clientTimeoutMs)
5564
: m_echoIntervalMs(echoIntervalMs), m_clientTimeoutMs(clientTimeoutMs) {

0 commit comments

Comments
 (0)