Skip to main content

encode_message

Function encode_message 

Source
pub fn encode_message(
    packet_type: PacketType,
    payload: &[u8],
    packet_size: usize,
) -> Result<Vec<u8>, PacketFrameError>
Expand description

Encodes a message payload into one or more TDS packets.

packet_size is the maximum packet length including the 8-byte header. The helper emits packet IDs starting at zero and sets END_OF_MESSAGE only on the final packet.