I have a problem with distinguishing TCP connections.
I have multiple devices connected to me using TCP IN node via port XXX. If i send any information using TCP OUT node, all the devices receive that info, while i need to send it only to a specific device.
Even if i move each device to a diffrent port, diffrent TCP IN and TCP OUT nodes, sending commands via one of TCP OUT nodes still causes all of the devices to receive that command.
Please note that devices are redirected to me from the router's external ip, so all the devices have ip of 192.168.1.1.
I had already tried assigning the devices to diffrent ports and separate nodes like in the uploaded picture.
Injecting messages to port 999 will cause the upper connection (port 998) to receive the message too. I also tried moving them to separate flows, but that also didnt do anything.
Again add a debug to the tcp in node, set to full message object and look at the _session object. The _session object has to make it to the out node. It has nothing to do with port numbers.
I think i have found the mistake that i was making:
Injecting a msg directly into TCP Output without any session info resulted in it being sent to every active connection.
I have made a crude program that catches msg._session and sends a message using that session information, and it seems to work now - BUT i have a problem with extracting all the sessions and redirecting them to diffrent routes, so i can handle them individually.