From a4f5c7040bc4f2dbeba228cba70b1945d91e74a2 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 17 Apr 2020 19:57:58 +0800 Subject: [PATCH] cleanup --- runtime/src/comms.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/runtime/src/comms.rs b/runtime/src/comms.rs index 7280f0ee..a8d61371 100644 --- a/runtime/src/comms.rs +++ b/runtime/src/comms.rs @@ -245,16 +245,15 @@ pub fn main() { task::spawn(async move { loop { - while let stream = TcpStream::accept(1381, 2048, 2048).await.unwrap() { - let control = control.clone(); - task::spawn(async { - let _ = handle_connection(&stream, control) - .await - .map_err(|e| println!("Connection: {}", e)); - let _ = stream.flush().await; - let _ = stream.abort().await; - }); - } + let stream = TcpStream::accept(1381, 2048, 2048).await.unwrap(); + let control = control.clone(); + task::spawn(async { + let _ = handle_connection(&stream, control) + .await + .map_err(|e| println!("Connection: {}", e)); + let _ = stream.flush().await; + let _ = stream.abort().await; + }); } });