Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Simplify creation of packets #2

Open
birdayz opened this issue Nov 18, 2018 · 0 comments
Open

Simplify creation of packets #2

birdayz opened this issue Nov 18, 2018 · 0 comments

Comments

@birdayz
Copy link
Contributor

birdayz commented Nov 18, 2018

Currently, there's no uniform way. Possible approach:

  • Factory method for each packet type
  • Setting remainingLength happens in factory method. When WriteTo is called, it can expect that the packet structure is already fully populated and valid. Possibly, validation could be called (or not, for performance reasons)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant