1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Change single connection mode to CLI arg instead of forced in debug mode

This commit is contained in:
NGnius (Graham)
2025-03-16 09:30:45 -04:00
parent ec565e904b
commit 792585a031
18 changed files with 81 additions and 81 deletions

View File

@@ -21,16 +21,16 @@ async fn main() -> std::io::Result<()> {
let listener = net::TcpListener::bind(std::net::SocketAddr::new(ip_addr, args.port)).await?;
#[cfg(not(debug_assertions))]
loop {
let (socket, address) = listener.accept().await?;
tokio::spawn(process_socket(socket, address, op_handler.clone(), redirect_static, room_name_static));
}
#[cfg(debug_assertions)]
{
if args.once {
log::warn!("Handling first connection and then exiting");
let (socket, address) = listener.accept().await?;
process_socket(socket, address, redirect_static, room_name_static).await;
Ok(())
} else {
loop {
let (socket, address) = listener.accept().await?;
tokio::spawn(process_socket(socket, address, redirect_static, room_name_static));
}
}
}