Hi !
Thank you for your answer, and very sorry for the lack of detailed information, I realize I sent the message a bit too quickly.
Actually, I made my tests using one of the example flows from the TCP node .
By playing again with it, I think that maybe my problem is the special caracters used in some of the nodes in the example . I attach some pics as I'm not sure how they'll appear in another text editor :
From the "set result" change node :
Result in Debug :
I dont really understand, I can see the TCP request node use a \n to close the connection, but I don't think it's relevant here.... However the TCP in use the same kind of delimitation caracters as what is described in the working inject nodes....
Strangest thing to me is when I use the inject node with string ending with \n , I don't get any direct reply but it seems they are put in some sort of cache, and when I then use a working inject node I get all the messages at once, including the previous ones....
Maybe I don't really get how the TCP nodes work ?
Flow here :
[{"id":"d2402e3.cf533d","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2e80c8be5fec29f9","type":"tcp in","z":"d2402e3.cf533d","name":"","server":"server","host":"localhost","port":"1883","datamode":"stream","datatype":"utf8","newline":"¥n","topic":"","trim":false,"base64":false,"tls":"","x":1230,"y":680,"wires":[["3ad5731de3d9aa2b"]]},{"id":"fe131238699f12ff","type":"inject","z":"d2402e3.cf533d","name":"Inject Expresion with ¥n","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"Hello, World!¥n\"","payloadType":"jsonata","x":1200,"y":460,"wires":[["5b281b1b21a6985e"]]},{"id":"f65e203a078b420d","type":"debug","z":"d2402e3.cf533d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1710,"y":580,"wires":[]},{"id":"5b281b1b21a6985e","type":"tcp request","z":"d2402e3.cf533d","name":"","server":"localhost","port":"1883","out":"char","ret":"buffer","splitc":"\\n","newline":"","trim":false,"tls":"","x":1350,"y":580,"wires":[["b3d0580296ad9241"]]},{"id":"7bf9a55e1aa32de3","type":"tcp out","z":"d2402e3.cf533d","name":"","host":"","port":"","beserver":"reply","base64":false,"end":false,"tls":"","x":1530,"y":680,"wires":[]},{"id":"3ad5731de3d9aa2b","type":"change","z":"d2402e3.cf533d","name":"set result","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Received: \" & payload & \"\b\\n\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":680,"wires":[["7bf9a55e1aa32de3"]]},{"id":"b3d0580296ad9241","type":"function","z":"d2402e3.cf533d","name":"Buffer to String","func":"msg.payload = msg.payload.toString();\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1540,"y":580,"wires":[["f65e203a078b420d"]]},{"id":"57561301fb1da8e3","type":"comment","z":"d2402e3.cf533d","name":"Send reply to client of TCP connection","info":"Input message from `TCP in` node may be passed to `TCP out` node to return a reply to client.\n","x":1230,"y":520,"wires":[]},{"id":"bd81a085e1bd3564","type":"comment","z":"d2402e3.cf533d","name":"↓ Accept request","info":"","x":1220,"y":640,"wires":[]},{"id":"eea92c66614eab02","type":"comment","z":"d2402e3.cf533d","name":"↓ Reply result","info":"","x":1550,"y":640,"wires":[]},{"id":"52bad1f87bc01676","type":"inject","z":"d2402e3.cf533d","name":"Inject string with ¥n","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"Hello, World!¥n\"","payloadType":"str","x":1190,"y":420,"wires":[["5b281b1b21a6985e"]]},{"id":"41a974b56932d651","type":"inject","z":"d2402e3.cf533d","name":"Inject String with \\n","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"Hello, World!\\n\"","payloadType":"str","x":1190,"y":380,"wires":[["5b281b1b21a6985e"]]},{"id":"1933ee27d9e25675","type":"inject","z":"d2402e3.cf533d","name":"Inject FlowContext+String","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$flowContext(\"MyFlowContext\") & \" blabla!¥n\"\t","payloadType":"jsonata","x":1210,"y":340,"wires":[["5b281b1b21a6985e"]]},{"id":"8e9c811c0dc922fd","type":"inject","z":"d2402e3.cf533d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1120,"y":180,"wires":[["fb5580bbbcde486a"]]},{"id":"fb5580bbbcde486a","type":"function","z":"d2402e3.cf533d","name":"Create Flow Context : MyFlowContext","func":"\nflow.set(\"MyFlowContext\", \"MyFlowContext\")\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1460,"y":180,"wires":[[]]},{"id":"ef3920de6ec79bfe","type":"comment","z":"d2402e3.cf533d","name":"Create flow variable","info":"","x":1130,"y":140,"wires":[]}]
Many thanks in advance !
Jerome