]> git.proxmox.com Git - mirror_novnc.git/commit - tests/test.rfb.js
Initiate connection from RFB constructor
authorPierre Ossman <ossman@cendio.se>
Sun, 18 Apr 2021 09:26:51 +0000 (11:26 +0200)
committerPierre Ossman <ossman@cendio.se>
Sun, 18 Apr 2021 12:27:57 +0000 (14:27 +0200)
commitdbd519558c1efd98afd08126594efc334eb88dd6
treea00556b43c41f8986392994f9880eb22bcafaa48
parentde9fc9508cb4bc6776792f0c7731da17519d4f24
Initiate connection from RFB constructor

We need to do this in order to safely attach to existing WebSocket
objects. There may be message events already pending so we must set up
our event handlers before returning.

This means we will now throw errors instead of generating "disconnect"
events on problems as the caller no longer has the opportunity to set up
event handlers.

This might have been the correct approach from the start as it mimics
how e.g. the WebSocket constructor works.
core/rfb.js
tests/test.rfb.js