technocreatives / node-red-contrib-jsonrpc2

Node Red wrapper around nodejs json-rpc2 implementation.
Other
4 stars 5 forks source link

Add support for netstring formatted JSON over raw TCP socket #2

Open oskarhagberg opened 8 years ago

oskarhagberg commented 8 years ago

Since TCP is a streaming protocol there is no sure way to seperate between the JSON messages if they are just sent as pure strings.

What netstring encoding does is simply to prepend the string with the length of the expected string followed by a : and end the string with a ,. For example 17{"hello":"world"},. The full specification can be found at http://cr.yp.to/proto/ netstrings.txt.