From 8d27548b234c54192a1af35880b57dfe4323cf75 Mon Sep 17 00:00:00 2001 From: rozzwalla Date: Thu, 23 Apr 2015 10:01:05 +0800 Subject: [PATCH] Update server.js Updated variable assignment for this.timeout to this._timeout and updated handler for the scoping the timeout assignment. --- lib/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index 8028ac4..4e72d63 100644 --- a/lib/server.js +++ b/lib/server.js @@ -35,14 +35,14 @@ Server.init = function(port, host, options) { this._clients = {}; this._port = port; this._host = host || 'localhost'; - this.timeout = (options && options.timeout) || 3600000; + this._timeout = (options && options.timeout) || 3600000; function handler(socket) { var client = socket.remoteAddress + ':' + socket.remotePort; // socket configurations socket.setKeepAlive(true, 60000); - socket.setTimeout(this._timeout); + socket.setTimeout(self._timeout); if (options && options.readEncoding) { socket.setEncoding(options.readEncoding);