netapp.rs: Set SO_REUSEPORT on listen_addr with TcpSocket. #9

Closed
jpds wants to merge 11 commits from jpds/netapp:so-reuseport into main
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 14ba9a811f - Show all commits

View file

@ -1,4 +1,5 @@
use std::io::Write; use std::io::Write;
use std::num::NonZeroUsize;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
@ -41,7 +42,7 @@ pub struct Opt {
view_size: usize, view_size: usize,
#[structopt(long = "cache-size", short = "c", default_value = "1000")] #[structopt(long = "cache-size", short = "c", default_value = "1000")]
cache_size: usize, cache_size: NonZeroUsize,
#[structopt(long = "exchange-interval-secs", short = "x", default_value = "1")] #[structopt(long = "exchange-interval-secs", short = "x", default_value = "1")]
exchange_interval: u64, exchange_interval: u64,

View file

@ -1,5 +1,6 @@
use std::collections::HashSet; use std::collections::HashSet;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::num::NonZeroUsize;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use std::time::Duration; use std::time::Duration;
@ -229,7 +230,7 @@ impl BasaltView {
pub struct BasaltParams { pub struct BasaltParams {
pub view_size: usize, pub view_size: usize,
pub cache_size: usize, pub cache_size: NonZeroUsize,
pub exchange_interval: Duration, pub exchange_interval: Duration,
pub reset_interval: Duration, pub reset_interval: Duration,
pub reset_count: usize, pub reset_count: usize,