-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP: Packet Fragmentation implementation | DO NOT MERGE #22
WIP: Packet Fragmentation implementation | DO NOT MERGE #22
Conversation
…nPost/amethyst-protocol into large_packet_implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, lots of comments but mostly questions. Lets address my questions and then ill give this another review. Overall amazing work @TimonPost 👍 .
// get specific slice of data for fragment | ||
let fragment_data = &payload[start_fragment_pos..end_fragment_pos]; | ||
|
||
packet_data.add_fragment(&fragment, fragment_data.to_vec()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think there might be a way to avoid this allocation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean .to_vec? If yes, I am going to try to make everything work with slices I am not happy yet because I do this for multiple places.
Very nice work, I mostly just had questions and a few nitpicks |
This is an implementation of fragmentation (issue). Looks like it is working, but need to test it more still. So work in progress...
Note that I have looked at this libary which had some basic implementation of fragmentation. It is from the author of gafferongames blogs:
Things I changed:
PacketHeader
This will contain all the header stuff we first had in RawPacket. This will be used for every packet.
Fragment Header
Fragment header the information of the fragments a packet is divided into. The first fragment packet will have two headers. The standard PacketHeader and the Fragment header the following fragments only have the fragment header.
byteorder
so that I can control more better how a header gets serialized an deserialized.Still, need to do: