group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
FragmentReassembler.hpp File Reference

Per-connection assembly buffer for fragmented UDP packets. More...

#include "PacketHeader.hpp"
#include <SDL3/SDL_stdinc.h>
#include <cstdint>
#include <vector>
Include dependency graph for FragmentReassembler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  net::FragmentReassembler
struct  net::FragmentReassembler::ActiveSet
struct  net::FragmentReassembler::OptionalSet

Namespaces

namespace  net

Detailed Description

Per-connection assembly buffer for fragmented UDP packets.

Stage 3d-4: snapshots above the MTU floor are split into multiple datagrams by UdpEndpoint::sendFragmented. The receiver pairs them by (sequence, fragmentInfo.count) until a complete set has arrived, then hands the assembled bytes back. UDP can reorder so fragments land in any order; missing fragments mean the whole logical message is lost — the caller drops the in-progress set when a newer sequence shows up. No retransmit (drop-stale is the contract).

Scope: this implementation tracks ONE in-progress reassembly per connection — the most-recent sequence we've started. If a newer sequence arrives before the current is complete, the current is abandoned. This is the simplest viable design and matches the "newer snapshot supersedes older" semantic the snapshot stream already has at the application layer. Multi-set tracking (e.g. for multiple concurrent unreliable channels) is a future enhancement.