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

TCP In: Fix error in timout callback (#1249)

Thanks @natcl
This commit is contained in:
Nathanaël Lécaudé 2017-05-09 17:09:21 -04:00 committed by Dave Conway-Jones
parent 40ad4bdbd8
commit 48958f392f

View File

@ -574,15 +574,17 @@ module.exports = function(RED) {
clients[connection_id].client.on('timeout',function() {
//console.log("TIMEOUT");
if (clients[connection_id]) {
clients[connection_id].connected = false;
node.status({fill:"grey",shape:"dot",text:"tcpin.errors.connect-timeout"});
//node.warn(RED._("tcpin.errors.connect-timeout"));
if (clients[connection_id] && clients[connection_id].client) {
if (clients[connection_id].client) {
clients[connection_id].client.connect(port, host, function() {
clients[connection_id].connected = true;
node.status({fill:"green",shape:"dot",text:"common.status.connected"});
});
}
}
});
}
else {