Skip to content

Commit

Permalink
Introduce UdpSocketState::try_send API for fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Oct 21, 2024
1 parent f547d5e commit e617ab9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions quinn-udp/src/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ impl UdpSocketState {
Ok(())
}

pub fn try_send(&self, socket: UdpSockRef<'_>, transmit: &Transmit<'_>) -> io::Result<()> {
socket.0.send_to(
transmit.contents,
&socket2::SockAddr::from(transmit.destination),
)
}

pub fn recv(
&self,
socket: UdpSockRef<'_>,
Expand Down

0 comments on commit e617ab9

Please sign in to comment.