From fa249a206c8c9a806195ce98471e0433b20b49e7 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 16 Sep 2022 10:56:43 +0200 Subject: [PATCH] tokio-tutorial-jbarszczewski: Handle each connection in separate task --- tokio-tutorial-jbarszczewski/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio-tutorial-jbarszczewski/src/main.rs b/tokio-tutorial-jbarszczewski/src/main.rs index 5d49be5..e1c7800 100644 --- a/tokio-tutorial-jbarszczewski/src/main.rs +++ b/tokio-tutorial-jbarszczewski/src/main.rs @@ -7,7 +7,7 @@ async fn main() { loop { let (stream, _) = listener.accept().await.unwrap(); - handle_connection(stream).await; + tokio::spawn(async move { handle_connection(stream).await }); } } -- 2.39.5