Thanks for the quick reply,
PING/PONG is done automatically in the background, but the use case is a little different here.
I am connected to the server but not sending or receiving anything for a few minutes(basically idle), then after 40 seconds my server shows a "WebSocket pong timeout" and "Disconnected".
[2023-09-20 16:10:57.640][ActivHandler][I] client connected
[2023-09-20 16:10:57.641][ActivHandler][D] Status is CONNECTED
[31m[2023-09-20 16:12:16.925][ERROR][lodis-com][#1996269600][CConnectionBase.hpp:265][operator()]Websocket pong timeout[0m
[2023-09-20 16:12:16.934][ActivHandler][T] path event: connected 64
[2023-09-20 16:12:16.936][ActivHandler][I] client disconnected
Though I have set KeepAliveInterval to (0,0,20). I want to ping the server every 20 or 30 seconds(in an idle state) so that it won't get disconnected.
Is it correct to use poll() with Timer? coz this is the only way I found to keep my connection alive?