From 863538829782498ad72997f4f41a3aebb9b1f6b1 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 31 Jan 2020 21:35:47 -0800 Subject: [PATCH] Updated tunnel, so it sets idle timeout, if supported by agent --- agents/meshcore.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/agents/meshcore.js b/agents/meshcore.js index a0f03d8f..215cdbe0 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -991,6 +991,17 @@ function createMeshCore(agent) { s.end = onTunnelClosed; s.tunnel = this; + if (require('MeshAgent').idleTimeout != null) + { + s.setTimeout(require('MeshAgent').idleTimeout * 1000); + s.on('timeout', function () + { + this.ping(); + this.setTimeout(require('MeshAgent').idleTimeout * 1000); + }); + } + + //sendConsoleText('onTunnelUpgrade - ' + this.tcpport + ' - ' + this.udpport); if (this.tcpport != null) {