Document and draft the specifications of the protocol
While this is designed for a Quest companion mod in mind, it would be nice to have it generalized for other use cases such as multi-computer setups (maybe?).
Currently, I've yet to decide on whether protobuf or JSON serialization will be used. If we go with JSON, serialization and data classes are simpler and easy to write. The problem then is deserializing (securely) fast and safely.
Methods of deserializing JSON:
Delimeter: Use a char such as \n to split strings. While easy as this may be, it could be equally complex to handle safely when the delimeter char is used for non-delimeter purposes.
Length prepend: This is the more complex though safer approach. It involves either reserving a number of bytes as padding or sending before the actual data to define the length of the incoming data.
Protobuf may or may not solve both of these issues, I've yet to look into protobuf enough to understand properly the correct usage in this scenario.
The networking implementation is also questionable, the way I see it. It feels fragile and far too complex, it needs cleaning and simplifying for others to be able to maintain.
The purpose of this PR is a few:
While this is designed for a Quest companion mod in mind, it would be nice to have it generalized for other use cases such as multi-computer setups (maybe?).
Currently, I've yet to decide on whether protobuf or JSON serialization will be used. If we go with JSON, serialization and data classes are simpler and easy to write. The problem then is deserializing (securely) fast and safely. Methods of deserializing JSON:
\n
to split strings. While easy as this may be, it could be equally complex to handle safely when the delimeter char is used for non-delimeter purposes.Protobuf may or may not solve both of these issues, I've yet to look into protobuf enough to understand properly the correct usage in this scenario.
The networking implementation is also questionable, the way I see it. It feels fragile and far too complex, it needs cleaning and simplifying for others to be able to maintain.