Added timeout on socket

This commit is contained in:
Wu Cheng-Han 2015-09-25 18:34:34 +08:00
parent 3ab04d4f02
commit b87463ae0d
1 changed files with 3 additions and 1 deletions

View File

@ -997,7 +997,9 @@ function havePermission() {
}
//socket.io actions
var socket = io.connect();
var socket = io.connect({
timeout: 10000 //10 secs to timeout
});
//overwrite original event for checking login state
var on = socket.on;
socket.on = function () {