From 3a73816a4360f0805859f7ea56fbc1b1a0ffc82c Mon Sep 17 00:00:00 2001 From: Guthyerrz Maciel Date: Tue, 12 Jul 2016 16:33:50 -0300 Subject: [PATCH] Sending timeout when available in the handshake response --- lib/connectors/commands/handshake.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/connectors/commands/handshake.js b/lib/connectors/commands/handshake.js index e575ba83f..3ed7163cd 100644 --- a/lib/connectors/commands/handshake.js +++ b/lib/connectors/commands/handshake.js @@ -23,6 +23,10 @@ var Command = function(opts) { this.heartbeat = opts.heartbeat * 1000; } + if(opts.timeout){ + this.timeout = opts.timeout; + } + this.checkClient = opts.checkClient; this.useDict = opts.useDict; @@ -44,6 +48,10 @@ Command.prototype.handle = function(socket, msg) { heartbeat : setupHeartbeat(this) }; + if(this.timeout){ + opts.timeout = this.timeout; + } + if(this.useDict) { var dictVersion = pomelo.app.components.__dictionary__.getVersion(); if(!msg.sys.dictVersion || msg.sys.dictVersion !== dictVersion){ @@ -53,7 +61,7 @@ Command.prototype.handle = function(socket, msg) { opts.routeToCode = pomelo.app.components.__dictionary__.getDict(); opts.codeToRoute = pomelo.app.components.__dictionary__.getAbbrs(); - opts.dictVersion = dictVersion; + opts.dictVersion = dictVersion; } opts.useDict = true; }