libvncserver icon indicating copy to clipboard operation
libvncserver copied to clipboard

Added handshakeType to tell the server about the expected timeout is use.

Open sgh opened this issue 5 years ago • 6 comments

For long latency clients then may not be able to deliver the websocket handshake before we fall back to regular the RFB protocol.

Now it is possible to set expect_ws_handshake=1 which will increase the timeout to be rfbMaxClientWait or maxClientWait if set.

sgh avatar Dec 16 '20 13:12 sgh

added my comments in the issue https://github.com/LibVNC/libvncserver/issues/438

matti avatar Dec 16 '20 14:12 matti

This seems to be about configuring the server that only websockets clients will connect and in turn increasing timeout levels. Needs testing and API documentation via doc comments.

bk138 avatar Apr 28 '22 14:04 bk138

increasing handshake wont fix this for slow networks, it just increases propability to succeed and makes ws connections to start slower

this dual mode operation should just be change to be either or

matti avatar Apr 29 '22 08:04 matti

WS-connections start "immediately" because they transmit the handshake. Regular clients will have to wait - in this case 500ms. The proposed solution will work as long as the network delay is < 500ms. I chose that duration because it seemed fairly acceptable to normal RFB-clients and usually your ping time does not exceed 500 ms. 2G cellular networks might give you 1000 ms roundtrips but I think that VNC will be unusable on 2G. Also - the current 100ms timeout is a "probabillity thing" as well.

The overall protocol design separating RFB and WS/WSS is not optimal - therefore the catch-all solution we be as well :)

sgh avatar Apr 29 '22 08:04 sgh

agreed

matti avatar Apr 29 '22 09:04 matti

Maybe introducing handshaketype makes things overly complicated: Why not simply use cl->screen->maxClientWait instead of WEBSOCKETS_CLIENT_CONNECT_WAIT_MS or introduce a rfbScreen.maxWebSocketClientWait instead of the harcoded WEBSOCKETS_CLIENT_CONNECT_WAIT_MS?

bk138 avatar Apr 30 '22 08:04 bk138