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: difference between textMessageReceived and textFrameReceived ?

QWebSocket: difference between textMessageReceived and textFrameReceived ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • R Offline
    R Offline
    rmam
    wrote on last edited by rmam
    #1

    I've been trying out Qt's WebSockets implementation with a small client-server example similar to the Echo Client and Echo Server in Qt WebSocket examples page, and I've noticed that at least in some circumstances textMessageReceived and textFrameReceived are fired with the exact same content. However, the documentation is very scarce in details such as if both signals are emitted redundantly or if there is a limit on the string size passed through textMessageReceived, or in what conditions is textMessageReceived emitted. Does anyone know if there is any information on how and why these signals are fired, and when it's safe to ignore one and just listen for another?

    Edit: after browsing QWebSocket's source code, it appears that textMessageReceived and textFrameReceived pass redundant information, with the notable difference that textMessageReceived is emitted when textFrameReceived is emitted with the last frame.

    raven-worxR 1 Reply Last reply
    0
    • R rmam

      I've been trying out Qt's WebSockets implementation with a small client-server example similar to the Echo Client and Echo Server in Qt WebSocket examples page, and I've noticed that at least in some circumstances textMessageReceived and textFrameReceived are fired with the exact same content. However, the documentation is very scarce in details such as if both signals are emitted redundantly or if there is a limit on the string size passed through textMessageReceived, or in what conditions is textMessageReceived emitted. Does anyone know if there is any information on how and why these signals are fired, and when it's safe to ignore one and just listen for another?

      Edit: after browsing QWebSocket's source code, it appears that textMessageReceived and textFrameReceived pass redundant information, with the notable difference that textMessageReceived is emitted when textFrameReceived is emitted with the last frame.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @rmam
      A websocket data transfer contains of so called "frames". I can't tell you right now if QtWebSockets also does framing, or is simply using a single frame. But it may be needed if you let "3rd party" servers/clients connect to your application.

      See also framing in the WebSocket protocol standard

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • R Offline
        R Offline
        rmam
        wrote on last edited by
        #3

        Thanks for the input, @raven-worx . Appreciate it.

        1 Reply Last reply
        0

        • Login

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