JS: Better deal with buggy WebSocket implementations.

This commit is contained in:
Stefan Thomas
2013-03-13 17:57:54 +01:00
parent 1a7d542396
commit 2b3a39ddd9

View File

@@ -110,6 +110,9 @@ Server.prototype.connect = function ()
self.emit('socket_close');
self._set_state('offline');
// Prevent additional events from this socket
ws.onopen = ws.onerror = ws.onclose = ws.onmessage = function () {};
// Should we be connected?
if (!self._should_connect) return;