1

Does WebSocket QML Type support any ping/pong system?

Documentation doesn't say anything about it, so I'm wondering if there is a way to "simulate" ping/pong, e.g. trying to use one of the send methods and check what comes back in the co-responding received signal?

Or should I use QWebSocket Class to implement it? Also would it be bad practice to keep the QML WebSocket for send/receive functionality, while using the class just for ping/pong purpose, so better just implement whole functionality in the class?

light01
  • 155
  • 1
  • 3
  • 17
  • What do you mean saying `ping-pong system`? If all you want is to just send something and receive response so `WebSocket` has ` sendTextMessage` function and `textMessageReceived` signal. – folibis May 12 '19 at 07:49
  • I mean ping-pong system that occasionally, well, pings the server to see if the connection is still up. I haven't done much with websockets before (besides send normal text messages), but if I'm not mistaken, it's different from a normal send message, which can be seen in the class documentation. Maybe the normal send message works to, but I'd rather make sure than make a bad implementation. – light01 May 13 '19 at 06:14

0 Answers0