Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebSocket doesn't detect lost connection?
Forum Updated to NodeBB v4.3 + New Features

QWebSocket doesn't detect lost connection?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 144 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ocgltd
    wrote on 13 Mar 2024, 12:32 last edited by ocgltd
    #1

    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?

    J 1 Reply Last reply 13 Mar 2024, 12:55
    0
    • O ocgltd
      13 Mar 2024, 12:32

      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?

      J Offline
      J Offline
      JonB
      wrote on 13 Mar 2024, 12:55 last edited by
      #2

      @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 Reply Last reply
      1
      • O ocgltd has marked this topic as solved on 13 Mar 2024, 18:35

      1/2

      13 Mar 2024, 12:32

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved