Skip to main content

encode_header

Function encode_header 

Source
pub fn encode_header(
    out: &mut [u8; 14],
    fin: bool,
    opcode: Opcode,
    len: u64,
    mask: Option<[u8; 4]>,
) -> usize
Expand description

Writes a frame header into out; returns its length (2 to 14 bytes). Clients must pass a fresh random mask per frame and mask the payload with apply_mask; servers pass None.