Closed gbalke closed 3 years ago
Length + JSON string sounds simple enough that it would work, the alternative would be sending JSON straight away I guess? But not sure if the library has convenient functions for "read from this socket and return when a whole JSON message has been received", if it doesn't it might be too much work.
Brought about by this suggestion: https://github.com/osrf/ovc/pull/61#issuecomment-898137828
I'm debating working on using JSON in #61 or another PR. Here's some sample code that I think I'll be basing the implementation off of:
Output:
Still not sure if I should change the serialization (struct vs an actual library). I could just replace the whole host -> client message with a length field followed by the JSON string. Something about it doesn't feel right but it would work... :shrug:
@luca-della-vedova thougths?