This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Signal k TCP data source ... help please
#4
I'd be surprised if putting the whole delta on a single line would not work given that I am one of the primary authors of the server and know how things work underneath the hood. If you know better feel free to ignore my advice.

The issue here is that a TCP stream is just a stream of bytes, there is no concept of a message in TCP. The receiver either needs to parse the input on the fly, balancing parentheses and breaking the input to delta messages, or we can choose a message delimiter. We have chosen newline as the delimiter, making the receiver much simpler, it just splits the input to messages by lines.

Once the input is split to individual messages newlines and whitespace no longer matter, each message is parsed as a JSON document. Documentation is formatted for easy reading and reflects this. Playground parses a single message as JSON. If you paste more than one message to Playground it will complain about invalid JSON - it is trying to handle just a single message, not the contents of a stream.

If you start the server in demo mode with sample data playback and netcat to port 8375 you will see deltas, one per line. This should be your reference - this is what the Signal K tcp input handles.
Reply


Messages In This Thread
RE: Signal k TCP data source ... help please - by tkurki - 2019-07-01, 09:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)