On 11/01/2024 17:17, Gauthier Brin wrote:
> Hi,
> I would like to know if it's possible to determine if the noVnc is sending
> message in the web Socket or if it's ready ? could be something like a
> heart beat or ping pong system?
>
WebSockets have a ping feature, but I don't think it's reachable from
JavaScript. So any such system would need to be built at the RFB level.
Which means you need to do it in the RFB object, not outside of it.
VNC/RFB doesn't have a dedicated ping system, so you would need to get
creative. The fence message could probably be used, but not all servers
support that.
> One possible use case could be:
> - if the user has lost his network connection, we would like do display a
> reconnecting screen until he get back his internet connection and the
> websocket is ready.
>
That is definitely an interesting use case. It's something we've
discussed here as well.
I don't think it's well behaved to spam pings constantly, but you could
likely combine it with user interactions. E.g. if the user uses the
mouse or keyboard, but we don't get anything back from the server within
a timeout, then send a ping to make sure we still have contact.
Regards
--
Pierre Ossman Software Development
Cendio AB
http://cendio.com
Teknikringen 8
http://twitter.com/ThinLinc
583 30 Linköping
http://facebook.com/ThinLinc
Phone:
+46-13-214600
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?