Skip to main content

send_frame_write

Function send_frame_write 

Source
pub async fn send_frame_write(
    stream: &mut OwnedWriteHalf,
    data: &[u8],
    kind: &FrameKind,
) -> Result<(), ConnectError>
Expand description

Send a framed message via an OwnedWriteHalf (split connection).

Header and payload are combined into a single Vec before calling write_all, reducing write syscalls from 2 -> 1 per frame. With Abridged framing this previously sent a 1-byte header then the payload in separate syscalls (and two TCP segments even with TCP_NODELAY on fast paths).