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 141 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.
  • ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on 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?

    JonBJ 1 Reply Last reply
    0
    • ocgltdO 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?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 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
      • ocgltdO ocgltd has marked this topic as solved on

      • Login

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