I'm writing a simple streaming JSON service. It consists of JSON messages, sent intermittently, for a long period of time (weeks or months).
What is the best practise with regard to sending multiple JSON messages over a plain TCP socket?
Some alternatives I have looked at (and their downsides) are:
Is there a good, or at least well-established way of doing this?
I've codified what I and some other developers are doing:
http://en.wikipedia.org/wiki/Line_Delimited_JSON
It has the advantage of being netcat/telnet compatible.
See also: http://ndjson.org/