Tcpin, status and _session

Hello, I'm trying to use multiple tcp connections in the same flow. Sometimes I send the first message to the tcp connection so I need to know the _session ID of each connection to avoid send the message to all the connections. I read in this post --> https://discourse.nodered.org/t/tcp-flow-almost-got-it-working/9274 that I can use the status message to get the ID of the connection, but it dosn't work.
Looking into the code, in the file 31-tcpin.js y made this change and now it's works fine (line 78)

var setupTcpClient = function() {
node.log(RED.("tcpin.status.connecting",{host:node.host,port:node.port}));
node.status({fill:"grey",shape:"dot",text:"common.status.connecting"});
var id = (1+Math.random()*4294967295).toString(16);
client = net.connect(node.port, node.host, function() {
buffer = (node.datatype == 'buffer') ? Buffer.alloc(0) : "";
node.connected = true;
node.log(RED.
("tcpin.status.connected",{host:node.host,port:node.port}));
node.status({fill:"green",shape:"dot",text:"common.status.connected"});
node.status({_session:id}); //This line is mine
});
client.setKeepAlive(true,120000);
connectionPool[id] = client;

Is it a bug or did I misunderstand the post? If it's a bug, how can I solve permantly (after an update, for example)? If not a bug, what is the correct way to do it?

Regards

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.