feature(console) addEvenets: add connect, disconect

This commit is contained in:
coderaiser 2014-01-27 09:43:02 -05:00
parent 47763f5ac5
commit d5ca8cf7b3
2 changed files with 26 additions and 10 deletions

View file

@ -151,7 +151,17 @@ var CloudCmd, Util, DOM, CloudFunc, $;
}
function addListeners(callback) {
CloudCmd.Socket.on('message', onMessage);
var socket = CloudCmd.Socket;
socket.on('message', onMessage);
socket.on('connect', function() {
log(socket.CONNECTED);
});
socket.on('disconnect', function() {
error(socket.DISCONNECTED);
});
Util.exec(callback);
}