udp: rewrite socket worker to use SocketWorker struct

Also, stop checking token number all the time
This commit is contained in:
Joakim Frostegård 2022-10-25 01:33:35 +02:00
parent 9d37b3d285
commit 4587c267d6
4 changed files with 366 additions and 400 deletions

View file

@ -21,6 +21,7 @@ use common::{
};
use config::Config;
use workers::socket::validator::ConnectionValidator;
use workers::socket::SocketWorker;
pub const APP_NAME: &str = "aquatic_udp: UDP BitTorrent tracker";
pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
@ -121,11 +122,10 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
WorkerIndex::SocketWorker(i),
);
workers::socket::run_socket_worker(
SocketWorker::run(
sentinel,
state,
config,
i,
connection_validator,
server_start_instant,
request_sender,