qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::io::transport::udp::ProxyOut Class Reference

Proxy class providing a stream-like interface for sending UDP datagrams. More...

#include <udp.h>

Public Member Functions

 ProxyOut (udp &prx)
 Constructor.
template<typename T>
auto & operator<< (T &&data)
 Stream output operator to append data to the current datagram being built.
std::size_t size ()
 Get the total size of data currently pending in the transport's output buffer for writing.

Detailed Description

Proxy class providing a stream-like interface for sending UDP datagrams.

This class allows data to be written using operator<< and ensures that the data is correctly associated with the current destination udp::identity and buffered as a distinct datagram in the UDP transport's output buffer.

Constructor & Destructor Documentation

◆ ProxyOut()

qb::io::transport::udp::ProxyOut::ProxyOut ( udp & prx)
inline

Constructor.

Parameters
prxReference to the udp transport this proxy will operate on.

Member Function Documentation

◆ operator<<()

template<typename T>
auto & qb::io::transport::udp::ProxyOut::operator<< ( T && data)
inline

Stream output operator to append data to the current datagram being built.

Template Parameters
TType of data to output.
Parameters
dataData to send.
Returns
Reference to this ProxyOut for chaining.

Appends data to the current message in the UDP transport's output buffer. Manages the size tracking for the current datagram being constructed.

◆ size()

std::size_t qb::io::transport::udp::ProxyOut::size ( )
inline

Get the total size of data currently pending in the transport's output buffer for writing.

Returns
Number of bytes pending for write across all datagrams in the buffer.