diff --git a/aquatic_udp_load_test/src/common.rs b/aquatic_udp_load_test/src/common.rs index 276c324..6f40729 100644 --- a/aquatic_udp_load_test/src/common.rs +++ b/aquatic_udp_load_test/src/common.rs @@ -4,9 +4,6 @@ use hashbrown::HashMap; use aquatic_udp_protocol::*; -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] -pub struct ThreadId(pub u8); - #[derive(PartialEq, Eq, Clone)] pub struct TorrentPeer { pub info_hash: InfoHash, diff --git a/aquatic_udp_load_test/src/main.rs b/aquatic_udp_load_test/src/main.rs index 8591911..2488659 100644 --- a/aquatic_udp_load_test/src/main.rs +++ b/aquatic_udp_load_test/src/main.rs @@ -62,7 +62,6 @@ fn run(config: Config) -> ::anyhow::Result<()> { // Start workers for i in 0..config.workers { - let thread_id = ThreadId(i); let port = config.network.first_port + (i as u16); let ip = if config.server_address.is_ipv6() { @@ -87,7 +86,7 @@ fn run(config: Config) -> ::anyhow::Result<()> { WorkerIndex::SocketWorker(i as usize), ); - run_worker_thread(state, pareto, &config, addr, thread_id) + run_worker_thread(state, pareto, &config, addr) }); } diff --git a/aquatic_udp_load_test/src/worker/mod.rs b/aquatic_udp_load_test/src/worker/mod.rs index 1968b92..816dafc 100644 --- a/aquatic_udp_load_test/src/worker/mod.rs +++ b/aquatic_udp_load_test/src/worker/mod.rs @@ -24,7 +24,6 @@ pub fn run_worker_thread( pareto: Pareto, config: &Config, addr: SocketAddr, - thread_id: ThreadId, ) { let mut socket = UdpSocket::from_std(create_socket(config, addr)); let mut buffer = [0u8; MAX_PACKET_SIZE]; @@ -32,7 +31,7 @@ pub fn run_worker_thread( let mut rng = SmallRng::from_rng(thread_rng()).expect("create SmallRng from thread_rng()"); let mut torrent_peers = TorrentPeerMap::default(); - let token = Token(thread_id.0 as usize); + let token = Token(0); let interests = Interest::READABLE; let timeout = Duration::from_micros(config.network.poll_timeout);