TCP connection setup

Node Red flow which sets up several TCP connections for undertanding how to work with TCP connections. Showing the different options (reply, listener, request)

this allows for connecting to multiple TCP connections at onces with the TCP request and replying to all of them with the TCP out node.

Is has injects on several place so you can immediatly see where what where the information ends up.

[{"id":"d87142fb81781ccb","type":"tcp request","z":"929639effe18bc4d","name":"","server":"localhost","port":"1001","out":"sit","ret":"string","splitc":" ","newline":"","tls":"","x":790,"y":360,"wires":[["91cc3bcb46a72d99"]]},{"id":"f38f18f4c14abb6d","type":"tcp in","z":"929639effe18bc4d","name":"","server":"server","host":"","port":"1001","datamode":"stream","datatype":"utf8","newline":"","topic":"test","base64":false,"tls":"","x":760,"y":560,"wires":[["647d4a7e8222db4c"]]},{"id":"a99823ca3d702139","type":"tcp in","z":"929639effe18bc4d","name":"","server":"server","host":"","port":"1000","datamode":"stream","datatype":"utf8","newline":"","topic":"Listener","base64":false,"tls":"","x":760,"y":500,"wires":[["c60b293f52c09d36"]]},{"id":"c60b293f52c09d36","type":"debug","z":"929639effe18bc4d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":500,"wires":[]},{"id":"647d4a7e8222db4c","type":"debug","z":"929639effe18bc4d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":560,"wires":[]},{"id":"8d3641c7ad9480af","type":"tcp request","z":"929639effe18bc4d","name":"","server":"localhost","port":"1000","out":"sit","ret":"string","splitc":" ","newline":"","tls":"","x":790,"y":440,"wires":[["3589ca0ccee4436a"]]},{"id":"91cc3bcb46a72d99","type":"debug","z":"929639effe18bc4d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":360,"wires":[]},{"id":"3589ca0ccee4436a","type":"debug","z":"929639effe18bc4d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":440,"wires":[]},{"id":"c234f9e941ab1029","type":"inject","z":"929639effe18bc4d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test1000","payloadType":"str","x":600,"y":440,"wires":[["8d3641c7ad9480af"]]},{"id":"ec41200c4a602b25","type":"inject","z":"929639effe18bc4d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test1001","payloadType":"str","x":600,"y":360,"wires":[["d87142fb81781ccb"]]},{"id":"8b3255c75252ad13","type":"tcp request","z":"929639effe18bc4d","name":"","server":"localhost","port":"1001","out":"sit","ret":"string","splitc":" ","newline":"","tls":"","x":790,"y":280,"wires":[["7c066dbb1f48b173"]]},{"id":"7c066dbb1f48b173","type":"debug","z":"929639effe18bc4d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":280,"wires":[]},{"id":"7e8b84d97b444381","type":"inject","z":"929639effe18bc4d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test1001","payloadType":"str","x":600,"y":280,"wires":[["8b3255c75252ad13"]]},{"id":"2eaf5511452829d9","type":"tcp out","z":"929639effe18bc4d","name":"","host":"localhost","port":"1002","beserver":"server","base64":false,"end":false,"tls":"","x":790,"y":620,"wires":[]},{"id":"14feb8801fbbff1a","type":"inject","z":"929639effe18bc4d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test999","payloadType":"str","x":590,"y":620,"wires":[["2eaf5511452829d9"]]},{"id":"b677ee8904135d7d","type":"tcp request","z":"929639effe18bc4d","name":"","server":"localhost","port":"1002","out":"sit","ret":"string","splitc":" ","newline":"","tls":"","x":790,"y":220,"wires":[["ec97681d11471e4c"]]},{"id":"ec97681d11471e4c","type":"debug","z":"929639effe18bc4d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":220,"wires":[]},{"id":"6e3e9eba7ac64f91","type":"inject","z":"929639effe18bc4d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test1001","payloadType":"str","x":600,"y":220,"wires":[["b677ee8904135d7d"]]},{"id":"14e73cb4a9d8e392","type":"tcp out","z":"929639effe18bc4d","name":"","host":"","port":"","beserver":"reply","base64":false,"end":false,"tls":"","x":1730,"y":240,"wires":[]},{"id":"8de492608d3f018c","type":"inject","z":"929639effe18bc4d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test ALL","payloadType":"str","x":1600,"y":240,"wires":[["14e73cb4a9d8e392"]]},{"id":"f4afb24e7e2702a3","type":"comment","z":"929639effe18bc4d","name":"Reply to all open connections","info":"","x":1660,"y":200,"wires":[]}]

Flow Info

Created 3 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x6)
  • inject (x6)
  • tcp in (x2)
  • tcp out (x2)
  • tcp request (x4)

Tags

  • tcp
  • tcprequest
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option