1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

close tcp node connection properly when required.

This commit is contained in:
Dave Conway-Jones 2015-12-23 20:01:05 +00:00
parent 8e25e76439
commit 9fb958b302

View File

@ -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;
}
}