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:
parent
8e25e76439
commit
9fb958b302
@ -276,7 +276,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
if (node.doend === true) {
|
if (node.doend === true) {
|
||||||
end = 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);
|
msg.payload = new Buffer(i+1);
|
||||||
buf.copy(msg.payload,0,0,i+1);
|
buf.copy(msg.payload,0,0,i+1);
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
//if (client) { client.end(); }
|
if (client) { node.status({}); client.destroy(); }
|
||||||
}, node.splitc);
|
}, node.splitc);
|
||||||
i = 0;
|
i = 0;
|
||||||
buf[0] = data[j];
|
buf[0] = data[j];
|
||||||
@ -452,7 +452,7 @@ module.exports = function(RED) {
|
|||||||
msg.payload = new Buffer(i);
|
msg.payload = new Buffer(i);
|
||||||
buf.copy(msg.payload,0,0,i);
|
buf.copy(msg.payload,0,0,i);
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
//if (client) { client.end(); }
|
if (client) { node.status({}); client.destroy(); }
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -464,7 +464,7 @@ module.exports = function(RED) {
|
|||||||
msg.payload = new Buffer(i);
|
msg.payload = new Buffer(i);
|
||||||
buf.copy(msg.payload,0,0,i);
|
buf.copy(msg.payload,0,0,i);
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
//if (client) { client.end(); }
|
if (client) { node.status({}); client.destroy(); }
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user