|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
💓 Client keepalive: periodic ping/pong exchange for reliable connection failure detection More...
Go to the source code of this file.
Macros | |
| #define | PING_INTERVAL_NS (1LL * NS_PER_SEC_INT) |
| #define | PING_SLEEP_INTERVAL_NS (1LL * NS_PER_SEC_INT) |
Functions | |
| int | keepalive_start_thread () |
| Start keepalive/ping thread. | |
| void | keepalive_stop_thread () |
| Stop keepalive/ping thread. | |
| bool | keepalive_thread_exited () |
| Check if keepalive thread has exited. | |
💓 Client keepalive: periodic ping/pong exchange for reliable connection failure detection
The keepalive system uses a dedicated ping thread:
Keepalive timing optimized for connection reliability:
Ping thread follows robust lifecycle management:
Multiple layers of connection health detection:
Keepalive errors handled with appropriate escalation:
Minimal resource usage for efficient keepalive:
Definition in file keepalive.c.
| #define PING_INTERVAL_NS (1LL * NS_PER_SEC_INT) |
Ping interval in nanoseconds (must be less than server timeout)
Definition at line 107 of file keepalive.c.
| #define PING_SLEEP_INTERVAL_NS (1LL * NS_PER_SEC_INT) |
Sleep interval for ping timing loop (1 second in nanoseconds)
Definition at line 110 of file keepalive.c.