mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-09 04:55:27 +00:00
Minor cleanup
This commit is contained in:
parent
798506a03c
commit
2632bf14be
1 changed files with 3 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ use {
|
||||||
net::{TcpListener, TcpStream},
|
net::{TcpListener, TcpStream},
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
stream::StreamExt,
|
stream::StreamExt,
|
||||||
task,
|
task::{block_on, spawn},
|
||||||
},
|
},
|
||||||
async_tls::TlsAcceptor,
|
async_tls::TlsAcceptor,
|
||||||
once_cell::sync::Lazy,
|
once_cell::sync::Lazy,
|
||||||
|
|
@ -22,11 +22,11 @@ struct Args {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result {
|
fn main() -> Result {
|
||||||
task::block_on(async {
|
block_on(async {
|
||||||
let listener = TcpListener::bind(&ARGS.sock_addr).await?;
|
let listener = TcpListener::bind(&ARGS.sock_addr).await?;
|
||||||
let mut incoming = listener.incoming();
|
let mut incoming = listener.incoming();
|
||||||
while let Some(Ok(stream)) = incoming.next().await {
|
while let Some(Ok(stream)) = incoming.next().await {
|
||||||
task::spawn(async {
|
spawn(async {
|
||||||
if let Err(e) = connection(stream).await {
|
if let Err(e) = connection(stream).await {
|
||||||
eprintln!("Error: {:?}", e);
|
eprintln!("Error: {:?}", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue