From ce1c0b24c34ef45c041b3e08258a0a9eac4cd79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 14 Nov 2021 03:04:10 +0100 Subject: [PATCH] udp: fix build failure; fix scripts/run-aquatic-udp.sh --- aquatic_udp/src/lib/other/mod.rs | 10 ++++++---- scripts/run-aquatic-udp.sh | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/aquatic_udp/src/lib/other/mod.rs b/aquatic_udp/src/lib/other/mod.rs index c526492..19e7c31 100644 --- a/aquatic_udp/src/lib/other/mod.rs +++ b/aquatic_udp/src/lib/other/mod.rs @@ -16,7 +16,9 @@ use crate::config::Config; pub mod common; pub mod handlers; +#[cfg(feature = "with-mio")] pub mod network_mio; +#[cfg(feature = "with-io-uring")] pub mod network_uring; pub mod tasks; @@ -107,8 +109,8 @@ pub fn run_inner(config: Config, state: State) -> ::anyhow::Result<()> { request_sender, response_receiver, num_bound_sockets, - ) - } else if #[cfg(feature = "with-mio")] { + ); + } else { network_mio::run_socket_worker( state, config, @@ -116,9 +118,9 @@ pub fn run_inner(config: Config, state: State) -> ::anyhow::Result<()> { request_sender, response_receiver, num_bound_sockets, - ) + ); } - ) + ); }) .with_context(|| "spawn socket worker")?; } diff --git a/scripts/run-aquatic-udp.sh b/scripts/run-aquatic-udp.sh index db41e58..0af7880 100755 --- a/scripts/run-aquatic-udp.sh +++ b/scripts/run-aquatic-udp.sh @@ -2,11 +2,13 @@ . ./scripts/env-native-cpu-without-avx-512 -if [ "$1" != "mio" ] && [ "$1" != "glommio" ]; then - echo "Usage: $0 [mio|glommio] [ARGS]" +if [ "$1" != "mio" ] && [ "$1" != "glommio" ] && [ "$1" != "io-uring" ]; then + echo "Usage: $0 [mio|glommio|io-uring] [ARGS]" else if [ "$1" = "mio" ]; then cargo run --release --bin aquatic_udp -- "${@:2}" + elif [ "$1" = "io-uring" ]; then + cargo run --release --features "with-io-uring" --no-default-features --bin aquatic_udp -- "${@:2}" else cargo run --release --features "with-glommio" --no-default-features --bin aquatic_udp -- "${@:2}" fi