Skip to content

Commit

Permalink
Use try_send, so the caller can handle the IO error (mozilla#2237)
Browse files Browse the repository at this point in the history
* Use try_send, so the caller can handle the IO error

* Use try_send in test
  • Loading branch information
KershawChang authored Nov 19, 2024
1 parent 77b2635 commit c6b518c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neqo-udp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn send_inner(
src_ip: None,
};

state.send(socket, &transmit)?;
state.try_send(socket, &transmit)?;

qtrace!(
"sent {} bytes from {} to {}",
Expand Down Expand Up @@ -256,7 +256,7 @@ mod tests {
segment_size: Some(SEGMENT_SIZE),
src_ip: None,
};
sender.state.send((&sender.inner).into(), &transmit)?;
sender.state.try_send((&sender.inner).into(), &transmit)?;

// Allow for one GSO sendmmsg to result in multiple GRO recvmmsg.
let mut num_received = 0;
Expand Down

0 comments on commit c6b518c

Please sign in to comment.