From 89357e7a47fbfc83155b5ebbdbe020d292ba899b Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 29 Oct 2013 12:47:36 +0000 Subject: [PATCH] feature(socket) reconnect_failed: mv from options to events --- lib/client/socket.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/client/socket.js b/lib/client/socket.js index 61e116ec..e59a8438 100644 --- a/lib/client/socket.js +++ b/lib/client/socket.js @@ -17,10 +17,7 @@ var CloudCmd, Util, DOM, io; function connect() { socket = io.connect(CloudCmd.HOST, { - 'max reconnection attempts' : Math.pow(2, 32), - 'reconnect_failed' : function() { - Util.log('Could not reconnect. Reload page.'); - } + 'max reconnection attempts' : Math.pow(2, 32) }); CloudCmd.Socket = socket; @@ -39,6 +36,10 @@ var CloudCmd, Util, DOM, io; socket.on('disconnect', function () { outToTerminal({stderr: 'socket disconected\n'}); }); + + socket.on('reconnect_failed', function () { + Util.log('Could not reconnect. Reload page.'); + }); } function outToTerminal(pMsg) {