dns_resolver::util::net

Function send_tcp_bytes

Source
pub async fn send_tcp_bytes(
    stream: &mut TcpStream,
    bytes: &mut [u8],
) -> Result<(), Error>
Expand description

Write a serialised message to a TCP channel. This sends a two-byte length prefix (big-endian u16) and sets or clears the TC flag as appropriate.

§Errors

If sending the message fails.

§Panics

If given an incomplete (< 12 byte) message.