don't wait for server close to clear timeout

This commit is contained in:
Roman Shtylman
2013-11-18 13:40:38 -05:00
parent 7fadd36106
commit 9db2bc5202

View File

@@ -39,7 +39,10 @@ var Proxy = function(opt, cb) {
// user has 5 seconds to connect before their slot is given up
function maybe_tcp_close() {
clearTimeout(conn_timeout);
conn_timeout = setTimeout(client_server.close.bind(client_server), 5000);
conn_timeout = setTimeout(function() {
client_server.close();
clearTimeout(conn_timeout);
}, 5000);
}
maybe_tcp_close();