From c98b5f396ffc37308e339943ddd0eba0fcbe518d Mon Sep 17 00:00:00 2001 From: Guido Longoni Date: Wed, 6 May 2026 12:20:44 +0200 Subject: [PATCH] Gestisci timeout sui client TCP --- red/tcp/tcp.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/red/tcp/tcp.js b/red/tcp/tcp.js index 9092c74..69c0b20 100644 --- a/red/tcp/tcp.js +++ b/red/tcp/tcp.js @@ -135,6 +135,10 @@ module.exports = function(RED) { buffer = null; } }); + client.on('timeout', function() { + node.log(RED._("tcpin.errors.timeout",{port:node.port})); + client.end(); + }); client.on('close', function() { delete connectionPool[id]; node.connected = false; @@ -310,6 +314,10 @@ module.exports = function(RED) { node.status({}); node.connected = false; }); + client.on('timeout', function() { + node.log(RED._("tcpin.errors.timeout",{port:node.port})); + client.end(); + }); client.on('close', function() { node.status({fill:"red",shape:"ring",text:"common.status.disconnected"}); node.connected = false;