Handle multipackets transparently #15

Open
opened 2026-06-11 17:42:36 +02:00 by oysteikt · 0 comments
Owner

We should have an API that both sends and receives unbounded body lengths, leaving the packet splitting stuff as an implementation detail. There should probably be a separate high-level struct to work with on the outside of this API.

For sending, this should be trivial as long as we pass a pointer + body size to the function. Just loop over and send the fragmented packets before returning.

For receiving, it's harder (see https://minecraft.wiki/w/RCON#Fragmentation). Maybe a reasonable way to handle this would be to accept max length packets until there either is a last packet without less than max length, or in the edge case where the last packet fits max length exactly, we wait for timeout and try one of the tricks listed in the wiki?

We should have an API that both sends and receives unbounded body lengths, leaving the packet splitting stuff as an implementation detail. There should probably be a separate high-level struct to work with on the outside of this API. For sending, this should be trivial as long as we pass a pointer + body size to the function. Just loop over and send the fragmented packets before returning. For receiving, it's harder (see https://minecraft.wiki/w/RCON#Fragmentation). Maybe a reasonable way to handle this would be to accept max length packets until there either is a last packet without less than max length, or in the edge case where the last packet fits max length exactly, we wait for timeout and try one of the tricks listed in the wiki?
oysteikt added the feature requestdeveloper experience labels 2026-06-11 17:42:36 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Projects/where-are-my-friends#15