Skip to main content

sender_task

Function sender_task 

Source
pub async fn sender_task(
    sender_rx: Receiver<SenderMessage>,
    data_tx: Sender<Vec<u8>>,
    ack_rx: Receiver<u8>,
    session_id: u32,
) -> Result<()>
Expand description

Runs the Go-Back-N sender loop, encoding SenderMessages with session_id, tracking unacknowledged frames via ResendSender, and retransmitting on timeout.

ยงErrors

Returns TargetDriverError::AckChannelClosed if ack_rx closes, TargetDriverError::RetransmissionLimit if retransmission attempts are exhausted, or TargetDriverError::ChannelSend if sending to data_tx fails.