We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f330d3 commit e9ac36cCopy full SHA for e9ac36c
neqo-common/src/udp.rs
@@ -27,9 +27,14 @@ impl Socket {
27
/// Calls [`std::net::UdpSocket::bind`] and instantiates [`quinn_udp::UdpSocketState`].
28
pub fn bind<A: ToSocketAddrs>(addr: A) -> Result<Self, io::Error> {
29
let socket = std::net::UdpSocket::bind(addr)?;
30
+ let state = quinn_udp::UdpSocketState::new((&socket).into())?;
31
+
32
+ // Reverse non-blocking flag set by `UdpSocketState` to make the test non-racy
33
+ #[cfg(test)]
34
+ socket.set_nonblocking(false)?;
35
36
Ok(Self {
- state: quinn_udp::UdpSocketState::new((&socket).into())?,
37
+ state,
38
socket: tokio::net::UdpSocket::from_std(socket)?,
39
})
40
}
0 commit comments