mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2413 from dvv/patch-1
Allow to know particular session from status node
This commit is contained in:
commit
18bf220ca4
@ -74,7 +74,7 @@ module.exports = function(RED) {
|
|||||||
buffer = (node.datatype == 'buffer') ? Buffer.alloc(0) : "";
|
buffer = (node.datatype == 'buffer') ? Buffer.alloc(0) : "";
|
||||||
node.connected = true;
|
node.connected = true;
|
||||||
node.log(RED._("tcpin.status.connected",{host:node.host,port:node.port}));
|
node.log(RED._("tcpin.status.connected",{host:node.host,port:node.port}));
|
||||||
node.status({fill:"green",shape:"dot",text:"common.status.connected"});
|
node.status({fill:"green",shape:"dot",text:"common.status.connected",_session:{type:"tcp",id:id}});
|
||||||
});
|
});
|
||||||
client.setKeepAlive(true,120000);
|
client.setKeepAlive(true,120000);
|
||||||
connectionPool[id] = client;
|
connectionPool[id] = client;
|
||||||
@ -121,7 +121,7 @@ module.exports = function(RED) {
|
|||||||
client.on('close', function() {
|
client.on('close', function() {
|
||||||
delete connectionPool[id];
|
delete connectionPool[id];
|
||||||
node.connected = false;
|
node.connected = false;
|
||||||
node.status({fill:"red",shape:"ring",text:"common.status.disconnected"});
|
node.status({fill:"red",shape:"ring",text:"common.status.disconnected",_session:{type:"tcp",id:id}});
|
||||||
if (!node.closing) {
|
if (!node.closing) {
|
||||||
if (end) { // if we were asked to close then try to reconnect once very quick.
|
if (end) { // if we were asked to close then try to reconnect once very quick.
|
||||||
end = false;
|
end = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user