Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Dec 11, 2023
1 parent d7ab90c commit 02cf3bd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions quinn/src/runtime/async_io.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_io::{Async, Timer};
use std::{
future::Future,
io,
Expand All @@ -8,6 +7,7 @@ use std::{
time::Instant,
};

use async_io::{Async, Timer};
use super::{AsyncTimer, AsyncUdpSocket, Runtime};

#[cfg(feature = "smol")]
Expand All @@ -33,7 +33,7 @@ mod smol {
&self,
sock: std::net::UdpSocket,
) -> io::Result<Arc<dyn AsyncUdpSocket>> {
Ok(Arc::new(AsyncIOUdpSocket::new(sock)?))
Ok(Arc::new(UdpSocket::new(sock)?))
}
}
}
Expand Down Expand Up @@ -61,7 +61,7 @@ mod async_std {
&self,
sock: std::net::UdpSocket,
) -> io::Result<Arc<dyn AsyncUdpSocket>> {
Ok(Arc::new(AsyncIOUdpSocket::new(sock)?))
Ok(Arc::new(UdpSocket::new(sock)?))
}
}
}
Expand All @@ -77,12 +77,12 @@ impl AsyncTimer for Timer {
}

#[derive(Debug)]
struct AsyncIOUdpSocket {
struct UdpSocket {
io: Async<std::net::UdpSocket>,
inner: udp::UdpSocketState,
}

impl AsyncIOUdpSocket {
impl UdpSocket {
fn new(sock: std::net::UdpSocket) -> io::Result<Self> {
Ok(Self {
inner: udp::UdpSocketState::new((&sock).into())?,
Expand All @@ -91,7 +91,7 @@ impl AsyncIOUdpSocket {
}
}

impl AsyncUdpSocket for AsyncIOUdpSocket {
impl AsyncUdpSocket for UdpSocket {
fn poll_send(&self, cx: &mut Context, transmits: &[udp::Transmit]) -> Poll<io::Result<usize>> {
loop {
ready!(self.io.poll_writable(cx))?;
Expand Down

0 comments on commit 02cf3bd

Please sign in to comment.