mirror of
https://github.com/novnc/noVNC.git
synced 2026-08-29 16:40:26 +08:00
Revert "Fixed a race condition when attaching to an existing socket"
This reverts commit ef27628c6d. By
bypassing setTimeout() it creates other race conditions so this is not
the proper fix for the issue.
This commit is contained in:
+2
-11
@@ -286,17 +286,8 @@ export default class RFB extends EventTargetMixin {
|
||||
this._sock.on('error', e => Log.Warn("WebSocket on-error event"));
|
||||
|
||||
// Slight delay of the actual connection so that the caller has
|
||||
// time to set up callbacks.
|
||||
// This it not possible when a pre-existing socket is passed in and is just opened.
|
||||
// If the caller creates this object in the open() callback of a socket and there's
|
||||
// data pending doing it next tick causes a packet to be lost.
|
||||
// This is particularly noticable for RTCDataChannel's where the other end creates
|
||||
// the channel and the client, this end, gets notified it exists.
|
||||
if (typeof urlOrChannel === 'string') {
|
||||
setTimeout(this._updateConnectionState.bind(this, 'connecting'));
|
||||
} else {
|
||||
this._updateConnectionState('connecting');
|
||||
}
|
||||
// time to set up callbacks
|
||||
setTimeout(this._updateConnectionState.bind(this, 'connecting'));
|
||||
|
||||
Log.Debug("<< RFB.constructor");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user