From 9fb958b3021ca432ad8ada34acaab8062bee3530 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 23 Dec 2015 20:01:05 +0000 Subject: [PATCH] close tcp node connection properly when required. --- nodes/core/io/31-tcpin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodes/core/io/31-tcpin.js b/nodes/core/io/31-tcpin.js index 75dbf0aa0..c9e9008b7 100644 --- a/nodes/core/io/31-tcpin.js +++ b/nodes/core/io/31-tcpin.js @@ -276,7 +276,7 @@ module.exports = function(RED) { } if (node.doend === true) { end = true; - if (client) { client.end(); } + if (client) { node.status({}); client.destroy(); } } } }); @@ -438,7 +438,7 @@ module.exports = function(RED) { msg.payload = new Buffer(i+1); buf.copy(msg.payload,0,0,i+1); node.send(msg); - //if (client) { client.end(); } + if (client) { node.status({}); client.destroy(); } }, node.splitc); i = 0; buf[0] = data[j]; @@ -452,7 +452,7 @@ module.exports = function(RED) { msg.payload = new Buffer(i); buf.copy(msg.payload,0,0,i); node.send(msg); - //if (client) { client.end(); } + if (client) { node.status({}); client.destroy(); } i = 0; } } @@ -464,7 +464,7 @@ module.exports = function(RED) { msg.payload = new Buffer(i); buf.copy(msg.payload,0,0,i); node.send(msg); - //if (client) { client.end(); } + if (client) { node.status({}); client.destroy(); } i = 0; } }