feature(socket) reconnect_failed: mv from options to events

This commit is contained in:
coderaiser 2013-10-29 12:47:36 +00:00
parent 6a84d8330c
commit 89357e7a47

View file

@ -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) {