A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::net::ByteReassembler Class Reference

Bounded, thread-safe reassembly for interleaved binary messages. More...

#include <cpp/a11/net/byte_chunking.h>

Classes

struct  Impl
 

Public Member Functions

 ByteReassembler (ByteChunkingOptions options)
 Construct a reassembler with already validated limits.
 
 ~ByteReassembler ()
 
 ByteReassembler (const ByteReassembler &)=delete
 
ByteReassembleroperator= (const ByteReassembler &)=delete
 
absl::StatusOr< std::optional< std::string > > Feed (std::string packet)
 Admit one packet and return a complete message when this finishes one.
 
void Clear ()
 Discard every incomplete message, for example when a channel aborts.
 
size_t pending_message_count () const
 Number of message ids currently awaiting more packets.
 
size_t pending_byte_count () const
 Aggregate payload bytes retained by incomplete messages.
 

Detailed Description

Bounded, thread-safe reassembly for interleaved binary messages.

Feed packets as a transport receives them. Packets for one message may be out of order and packets for several messages may interleave; Feed() returns an owned message only when all its pieces are present. Configured bounds protect an agent endpoint from unbounded partial-message memory.

Constructor & Destructor Documentation

◆ ByteReassembler() [1/2]

a11::net::ByteReassembler::ByteReassembler ( ByteChunkingOptions  options)
explicit

Construct a reassembler with already validated limits.

◆ ~ByteReassembler()

a11::net::ByteReassembler::~ByteReassembler ( )

◆ ByteReassembler() [2/2]

a11::net::ByteReassembler::ByteReassembler ( const ByteReassembler )
delete

Member Function Documentation

◆ Clear()

void a11::net::ByteReassembler::Clear ( )

Discard every incomplete message, for example when a channel aborts.

◆ Feed()

absl::StatusOr< std::optional< std::string > > a11::net::ByteReassembler::Feed ( std::string  packet)

Admit one packet and return a complete message when this finishes one.

◆ operator=()

ByteReassembler & a11::net::ByteReassembler::operator= ( const ByteReassembler )
delete

◆ pending_byte_count()

size_t a11::net::ByteReassembler::pending_byte_count ( ) const

Aggregate payload bytes retained by incomplete messages.

◆ pending_message_count()

size_t a11::net::ByteReassembler::pending_message_count ( ) const

Number of message ids currently awaiting more packets.


The documentation for this class was generated from the following files: