Updated tunnel, so it sets idle timeout, if supported by agent

This commit is contained in:
Bryan Roe 2020-01-31 21:35:47 -08:00
parent c137eda4ac
commit 4d5331e018
1 changed files with 11 additions and 0 deletions

View File

@ -991,6 +991,17 @@ function createMeshCore(agent) {
s.end = onTunnelClosed; s.end = onTunnelClosed;
s.tunnel = this; 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); //sendConsoleText('onTunnelUpgrade - ' + this.tcpport + ' - ' + this.udpport);
if (this.tcpport != null) { if (this.tcpport != null) {