Refbox JSON message lacks a header
Closed this issue · 1 comments
kmeessen commented
The new JSON format for the refbox messages is based on sending plain JSON strings over a socket which makes a robust client implementation cumbersome. Adding a simple header would make the message parsing much easier and robust. The minimum information that the header contains should be the size of the payload of the message.
BernardoCunha commented
To simplify the client implementation, the simple solution that was used in the current protocol is to add a nul char ('\0') to the end of every message. Since '\0' don not ever happen within a JSON message, detection of this nul char determines the end of a message and, therefore, the beginning of the next one.