Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mio requirement from 0.6.17 to 0.8.10 #1511

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions neqo-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ license = "MIT OR Apache-2.0"
[dependencies]
neqo-crypto = { path = "./../neqo-crypto" }
neqo-transport = { path = "./../neqo-transport" }
neqo-common = { path="./../neqo-common" }
neqo-common = { path = "./../neqo-common" }
neqo-http3 = { path = "./../neqo-http3" }
neqo-qpack = { path = "./../neqo-qpack" }
structopt = "0.3.7"
regex = "1"
mio = "0.6.17"
mio = { version = "0.8.10", features = ["net", "os-poll"] }
mio-extras = "2.0.5"
log = {version = "0.4.0", default-features = false}
log = { version = "0.4.0", default-features = false }
qlog = "0.11.0"

[features]
Expand Down
18 changes: 9 additions & 9 deletions neqo-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::{
time::{Duration, Instant},
};

use mio::{net::UdpSocket, Events, Poll, PollOpt, Ready, Token};
use mio::{net::UdpSocket, Events, Interest, Poll, Token};
use mio_extras::timer::{Builder, Timeout, Timer};
use neqo_transport::ConnectionIdGenerator;
use structopt::StructOpt;
Expand Down Expand Up @@ -319,7 +319,7 @@ impl QuicParameters {

fn emit_packet(socket: &mut UdpSocket, out_dgram: Datagram) {
let sent = socket
.send_to(&out_dgram, &out_dgram.destination())
.send_to(&out_dgram, out_dgram.destination())
.expect("Error sending datagram");
if sent != out_dgram.len() {
eprintln!("Unable to send all {} bytes of datagram", out_dgram.len());
Expand Down Expand Up @@ -650,7 +650,7 @@ impl ServersRunner {
}

for (i, host) in self.hosts.iter().enumerate() {
let socket = match UdpSocket::bind(host) {
let socket = match UdpSocket::bind(*host) {
Err(err) => {
eprintln!("Unable to bind UDP socket: {err}");
return Err(err);
Expand All @@ -673,18 +673,18 @@ impl ServersRunner {
};
println!("Server waiting for connection on: {local_addr:?}{also_v4}");

self.poll.register(
&socket,
self.poll.registry().register(
&mut socket,
Token(i),
Ready::readable() | Ready::writable(),
PollOpt::edge(),
Interest::READABLE | Interest::WRITABLE,
)?;

self.sockets.push(socket);
}

self.poll
.register(&self.timer, TIMER_TOKEN, Ready::readable(), PollOpt::edge())?;
.registry()
.register(&mut self.timer, TIMER_TOKEN, Interest::READABLE)?;

Ok(())
}
Expand Down Expand Up @@ -816,7 +816,7 @@ impl ServersRunner {
if event.token() == TIMER_TOKEN {
self.process_timeout()?;
} else {
if !event.readiness().is_readable() {
if !event.is_readable() {
continue;
}
self.process_datagrams_and_events(event.token().0, true)?;
Expand Down
Loading