summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan <stefan@stefans-entwicklerecke.de>2016-12-12 23:40:29 +0100
committerGitHub <noreply@github.com>2016-12-12 23:40:29 +0100
commitda5ae8b1f7837b1f5b1f73a7f53c94e521901285 (patch)
tree46ad64bddfa1c278797b48e0f79d96ac476f816d /src
parent9d3f5781ebbd766a130fc8bda0e7d91553c2baa5 (diff)
parent352cec1811252a730199253a89cba71cb71aa390 (diff)
downloadetherpad-lite-da5ae8b1f7837b1f5b1f73a7f53c94e521901285.zip
Merge pull request #3085 from Gared/fix_socketio_options
Updated option parameters for socket.io to work with latest version
Diffstat (limited to 'src')
-rw-r--r--src/package.json2
-rw-r--r--src/static/js/pad.js33
2 files changed, 11 insertions, 24 deletions
diff --git a/src/package.json b/src/package.json
index bdbf35c2..f8d3cf86 100644
--- a/src/package.json
+++ b/src/package.json
@@ -16,7 +16,7 @@
"request" : "2.55.0",
"etherpad-require-kernel" : "1.0.9",
"resolve" : "1.1.7",
- "socket.io" : "1.4.5",
+ "socket.io" : "1.6.0",
"ueberdb2" : "0.3.0",
"express" : "4.13.4",
"express-session" : "1.13.0",
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index f8ff8578..a9eaf7d2 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -231,40 +231,27 @@ function handshake()
// Allow deployers to host Etherpad on a non-root path
'path': exports.baseURL + "socket.io",
'resource': resource,
- 'max reconnection attempts': 3,
- 'sync disconnect on unload' : false
+ 'reconnectionAttempts': 5,
+ 'reconnection' : true,
+ 'reconnectionDelay' : 1000,
+ 'reconnectionDelayMax' : 5000
});
- var disconnectTimeout;
-
socket.once('connect', function () {
sendClientReady(false);
});
socket.on('reconnect', function () {
- //reconnect is before the timeout, lets stop the timeout
- if(disconnectTimeout)
- {
- clearTimeout(disconnectTimeout);
- }
-
pad.collabClient.setChannelState("CONNECTED");
pad.sendClientReady(true);
});
- socket.on('disconnect', function (reason) {
- if(reason == "booted"){
- pad.collabClient.setChannelState("DISCONNECTED");
- } else {
- function disconnectEvent()
- {
- pad.collabClient.setChannelState("DISCONNECTED", "reconnect_timeout");
- }
-
- pad.collabClient.setChannelState("RECONNECTING");
-
- disconnectTimeout = setTimeout(disconnectEvent, 20000);
- }
+ socket.on('reconnecting', function() {
+ pad.collabClient.setChannelState("RECONNECTING");
+ });
+
+ socket.on('reconnect_failed', function(error) {
+ pad.collabClient.setChannelState("DISCONNECTED", "reconnect_timeout");
});
var initalized = false;