Tcp in node optionally sends zero length payload on connection

There are many client/server models whereby the client connects to the server and initiates the communication by sending data. At the present moment tcp in/out nodes cannot handle this model properly. This is because the _session information is only known by the "tcp in" node until some data has been received.
Here's an example flow:

[{"id":"c671ad9a.93fac","type":"tcp in","z":"2bfc9174.c47aae","name":"Connect","server":"client","host":"some.host","port":"1234","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":120,"y":760,"wires":[["638c0be8.1e3aec"]]},{"id":"638c0be8.1e3aec","type":"function","z":"2bfc9174.c47aae","name":"","func":"// Send messages to server and handle responses\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":800,"wires":[["cf18f7bb.88f0f8"]]},{"id":"cf18f7bb.88f0f8","type":"tcp out","z":"2bfc9174.c47aae","host":"","port":"","beserver":"reply","base64":false,"end":false,"name":"","x":430,"y":800,"wires":[]},{"id":"61548ffd.62583","type":"inject","z":"2bfc9174.c47aae","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":840,"wires":[["638c0be8.1e3aec"]]}]

The first time a timestamp is injected, the function node has no session information and as a result any data it sends will go to all open sockets. Once it has received a packet from the socket it can store the session information for later use.
If the tcp in node is extended so that it can optionally send a zero length payload upon connection then the function node will always have the session information.
The default should be to not send the zero length packet so as not to break any existing flows.

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