This commit is contained in:
Sebastien Bourdeauducq 2020-04-17 19:57:58 +08:00
parent e76b84335e
commit a4f5c7040b
1 changed files with 9 additions and 10 deletions

View File

@ -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;
});
}
});