QWebSocket doesn't detect lost connection?
-
wrote on 13 Mar 2024, 12:32 last edited by ocgltd
I have created a websocket which I then open - so far so good. Then I block the connection (using iptables) and the websocket never detects the loss of connection.
In addition, I send pings every 3 seconds (and never receive a pong after lost connection), yet still no disconnect signal from the websocket.
Am I expected to monitor pongs and do my own determination of disconnect (with timer)? Should QWebSocket send an error/disconnect signal once I block the port?
-
I have created a websocket which I then open - so far so good. Then I block the connection (using iptables) and the websocket never detects the loss of connection.
In addition, I send pings every 3 seconds (and never receive a pong after lost connection), yet still no disconnect signal from the websocket.
Am I expected to monitor pongs and do my own determination of disconnect (with timer)? Should QWebSocket send an error/disconnect signal once I block the port?
wrote on 13 Mar 2024, 12:55 last edited by@ocgltd
I would say "Yes" to first question and "No" to second.
You might like to look at forum.qt.io/topic/106382/how-to-check-server-life-using-qwebsocket-ping-pong. -
1/2