|
@@ -11,6 +11,7 @@
|
|
|
/* global io */
|
|
/* global io */
|
|
|
|
|
|
|
|
import SocketIoShim from './SocketIoShim'
|
|
import SocketIoShim from './SocketIoShim'
|
|
|
|
|
+
|
|
|
let ConnectionManager
|
|
let ConnectionManager
|
|
|
const ONEHOUR = 1000 * 60 * 60
|
|
const ONEHOUR = 1000 * 60 * 60
|
|
|
|
|
|
|
@@ -136,7 +137,14 @@ export default (ConnectionManager = (function() {
|
|
|
|
|
|
|
|
// handle network-level websocket errors (e.g. failed dns lookups)
|
|
// handle network-level websocket errors (e.g. failed dns lookups)
|
|
|
|
|
|
|
|
|
|
+ let connectionAttempt = 1
|
|
|
let connectionErrorHandler = err => {
|
|
let connectionErrorHandler = err => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ window.wsRetryHandshake &&
|
|
|
|
|
+ connectionAttempt++ < window.wsRetryHandshake
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return setTimeout(() => this.ide.socket.socket.connect(), 100)
|
|
|
|
|
+ }
|
|
|
this.updateConnectionManagerState('error')
|
|
this.updateConnectionManagerState('error')
|
|
|
sl_console.log('socket.io error', err)
|
|
sl_console.log('socket.io error', err)
|
|
|
if (this.wsUrl && !window.location.href.match(/ws=fallback/)) {
|
|
if (this.wsUrl && !window.location.href.match(/ws=fallback/)) {
|