Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft: Feature/socket client #12

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

Fernthedev
Copy link
Collaborator

The purpose of this PR is a few:

  • Track the progress of the socket implementation
  • Discuss the direction of the implementation
  • 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.

@Fernthedev Fernthedev changed the base branch from feature/Reimplement_initial_Twitch_logic to main December 3, 2021 18:14
@Fernthedev Fernthedev changed the base branch from main to feature/Reimplement_initial_Twitch_logic December 3, 2021 18:14
@Fernthedev Fernthedev force-pushed the feature/socket_client branch from 8aad587 to 54fa268 Compare December 5, 2021 19:56
@Fernthedev Fernthedev changed the base branch from feature/Reimplement_initial_Twitch_logic to main December 5, 2021 19:56
@Fernthedev Fernthedev marked this pull request as draft April 30, 2022 18:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant