From b87463ae0d3c3e02a578a67d63fb7170fcf63539 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Fri, 25 Sep 2015 18:34:34 +0800 Subject: Added timeout on socket --- public/js/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/js/index.js b/public/js/index.js index c151b533..1348aa7f 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -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 () { -- cgit v1.2.3