|
@@ -29,7 +29,8 @@ var Tools = {};
|
29
|
29
|
Tools.board = document.getElementById("board");
|
30
|
30
|
Tools.svg = document.getElementById("canvas");
|
31
|
31
|
Tools.socket = io.connect('', {
|
32
|
|
- "reconnection delay": 1, //Make the xhr connections as fast as possible
|
|
32
|
+ "reconnectionDelay": 100, //Make the xhr connections as fast as possible
|
|
33
|
+ "timeout": 1000 * 60 * 20 // Timeout after 20 minutes
|
33
|
34
|
});
|
34
|
35
|
Tools.curTool = null;
|
35
|
36
|
Tools.boardName = (function () {
|
|
@@ -204,6 +205,9 @@ function handleMessage(message) {
|
204
|
205
|
|
205
|
206
|
//Receive draw instructions from the server
|
206
|
207
|
Tools.socket.on("broadcast", handleMessage);
|
|
208
|
+Tools.socket.on("reconnect", function onReconnection() {
|
|
209
|
+ Tools.socket.emit("getboard", Tools.boardName);
|
|
210
|
+});
|
207
|
211
|
|
208
|
212
|
Tools.unreadMessagesCount = 0;
|
209
|
213
|
Tools.newUnreadMessage = function () {
|