NAME
Net::QUIC::Datagram - one UDP packet Net::QUIC wants sent
DESCRIPTION
A Datagram is an adapter object.
It is not an application message and it is not a QUIC Stream.
Net::QUIC::Driver passes Datagram objects to its send callback when QUIC has UDP output ready.
Each Datagram contains:
the complete UDP payload
the local source address
the peer destination address
the ECN codepoint for the IP header
Send data as one UDP datagram. Do not split it or combine it with another Datagram.
METHODS
data
my $bytes = $datagram->data;
Returns the complete UDP payload bytes.
local
my $local = $datagram->local;
Returns the packed local source address QUIC expects for this packet.
For a UDP socket bound to one concrete local address, the socket normally uses that address automatically.
For a wildcard-bound socket or a connection using more than one local path, the adapter may need a platform-specific source-address mechanism.
peer
my $peer = $datagram->peer;
Returns the packed destination socket address.
ecn
my $ecn = $datagram->ecn;
Returns the two ECN bits the adapter should place in the outgoing IP header:
0 Not-ECT
1 ECT(1)
2 ECT(0)
3 CE
An adapter that does not support ECN can ignore this value. QUIC will detect that ECN is not usable on that path and stop relying on it.