decode_server_to_client

Function decode_server_to_client 

Source
pub fn decode_server_to_client(
    bytes: &[u8],
    sink: &mut dyn DiagnosticSink,
) -> Result<ServerPacket, DPlusError>
Expand description

Decode a UDP datagram sent from a DPlus reflector (server → client).

§Errors

  • DPlusError::UnknownPacketLength for unrecognized lengths
  • DPlusError::DsvtMagicMissing for DSVT-length packets without the magic
  • DPlusError::StreamIdZero for voice packets with stream id 0
  • DPlusError::InvalidShortControlByte for 5-byte packets with unknown control

§See also

ircDDBGateway/Common/DPlusProtocolHandler.cpp — the reference parser this decoder mirrors (length-dispatch then DSVT-magic branch). xlxd/src/cdplusprotocol.cpp is a mirror reference.