continue if accept fails
This commit is contained in:
parent
0eed949a27
commit
02f44cfab6
21
src/main.rs
21
src/main.rs
@ -350,13 +350,22 @@ async fn tokio_main(config: Arc<Config>) -> eyre::Result<()> {
|
|||||||
"centralex server listening"
|
"centralex server listening"
|
||||||
);
|
);
|
||||||
|
|
||||||
while let Ok((stream, addr)) = listener.accept().await {
|
loop {
|
||||||
info!(%addr, "new connection");
|
let connection = listener.accept().await;
|
||||||
|
|
||||||
spawn(
|
match connection {
|
||||||
&format!("connection to {addr}"),
|
Ok((stream, addr)) => {
|
||||||
connection_handler(stream, addr, config.clone(), port_handler.clone()),
|
info!(%addr, "new connection");
|
||||||
);
|
|
||||||
|
spawn(
|
||||||
|
&format!("connection to {addr}"),
|
||||||
|
connection_handler(stream, addr, config.clone(), port_handler.clone()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
error!(%err, "failed to accept connection");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user