From 96e6423a0facb4646d6fa76ffb193ca14a6cd783 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Tue, 7 Jun 2016 19:12:37 +0200 Subject: [PATCH] Raised the default socket timeout and other minor changes --- lib/server.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/server.js b/lib/server.js index 4c2851a..f4aac11 100644 --- a/lib/server.js +++ b/lib/server.js @@ -83,14 +83,14 @@ function resetEnqLinkTimer() { var that = this; log.silly('larvitsmpp: lib/server.js: resetEnqLinkTimer() - Resetting the kill timer'); - if (this.enqLinkTimer) { - clearTimeout(this.enqLinkTimer); + if (that.enqLinkTimer) { + clearTimeout(that.enqLinkTimer); } - this.enqLinkTimer = setTimeout(function() { - log.info('larvitsmpp: lib/server.js: resetEnqLinkTimer() - Closing session due to timeout'); + that.enqLinkTimer = setTimeout(function() { + log.info('larvitsmpp: lib/server.js: resetEnqLinkTimer() - Closing session from ' + that.sock.remoteAddress + ':' + that.sock.remotePort + ' due to timeout'); that.closeSocket(); - }, this.options.timeout); + }, that.options.timeout); } /** @@ -154,7 +154,7 @@ function server(options, callback) { // Set default options options = merge({ 'port': 2775, - 'timeout': 30000 // 30 sec + 'timeout': 40000 // 40 sec }, options || {}); // Create a server instance, and chain the listen function to it