Closed Morgul closed 1 year ago
We discussed about the implementation for the communication protocol and we came to the conclusion that the best idea would be using a binary serializer, that way we avoid including the object keys and save bandwidth and storage space.
Actually we're using Protobuf now.
Found myself thinking about this:
My recommendation (from personal experience) would be to send JSON (Or, msgpack, if that's chosen for the recording plugin) wrapped in a netstring:
The format is, simply:
<Length>:<Message>,
where<Length>
is the length of<Message>
. The:
and,
are convention, but could be any predetermined characters. (Also, there's no need to escape the message contents which is a huge plus.)Implementing netstrings is pretty straight forward, and I've done it in about a dozen languages at this point. They're pretty resilient, fast, and simple to understand. Even better, we can implement this 100% natively in both C# and python.
If this seems like a reasonable direction, I'll do up a C# implementation and a simple python test server for it, as a proof of concept.