Unsolved QWebSocket: difference between textMessageReceived and textFrameReceived ?
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
textFrameReceivedare 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
textMessageReceivedemitted. 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
textFrameReceivedpass redundant information, with the notable difference that
textMessageReceivedis emitted when
textFrameReceivedis emitted with the last frame.
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
Thanks for the input, @raven-worx . Appreciate it.