From 2ae1361d71ce3fe7b7386e1b3b8bd3df05cfea78 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 22 Aug 2013 10:59:11 +0000 Subject: [PATCH] feature(socket) add reconnection delay, max attempts --- lib/client/socket.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/client/socket.js b/lib/client/socket.js index a338c2c3..cde35d27 100644 --- a/lib/client/socket.js +++ b/lib/client/socket.js @@ -17,7 +17,12 @@ var CloudCmd, Util, DOM, io; function connect() { socket = io.connect(CloudCmd.HOST, { - reconnect: true + 'reconnect' : true, + 'reconnection delay' : 500, + 'max reconnection attempts' : 1000000, + 'reconnect_failed' : function() { + Util.log('Could not reconnect. Reload page.'); + } }); CloudCmd.Socket = socket;