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

clear tcpget node status if user changes target per message

This commit is contained in:
Dave Conway-Jones 2018-10-23 18:59:23 +01:00
parent 6382564727
commit f488869635
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -244,6 +244,7 @@ module.exports = function(RED) {
} }
RED.nodes.registerType("tcp in",TcpIn); RED.nodes.registerType("tcp in",TcpIn);
function TcpOut(n) { function TcpOut(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.host = n.host; this.host = n.host;
@ -419,6 +420,7 @@ module.exports = function(RED) {
} }
RED.nodes.registerType("tcp out",TcpOut); RED.nodes.registerType("tcp out",TcpOut);
function TcpGet(n) { function TcpGet(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.server = n.server; this.server = n.server;
@ -459,6 +461,10 @@ module.exports = function(RED) {
// the clients object will have: // the clients object will have:
// clients[id].client, clients[id].msg, clients[id].timeout // clients[id].client, clients[id].msg, clients[id].timeout
var connection_id = host + ":" + port; var connection_id = host + ":" + port;
if (connection_id !== node.last_id) {
node.status({});
node.last_id = connection_id;
}
clients[connection_id] = clients[connection_id] || { clients[connection_id] = clients[connection_id] || {
msgQueue: new Denque(), msgQueue: new Denque(),
connected: false, connected: false,