Update mod.rs

This commit is contained in:
Luuk van Oijen committed 2023-11-08 11:47:23 +01:00
1 parent 38aaf29fe8
commit 190cc8f238
1 file changed
+5 -2
+5 -2
View File
@@ -72,9 +72,11 @@ impl Server {
let connect_runtime_handle = tokio::spawn(async move { let connect_runtime_handle = tokio::spawn(async move {
loop { loop {
match tcp_listener_ref.accept().await { match tcp_listener_ref.accept().await {
Ok((socket, addr)) => { Ok((mut socket, addr)) => {
info!("New client connected: {:?}", addr); info!("New client connected: {:?}", addr);
socket.set_nodelay(true);
let mut client = Client::new(socket); let mut client = Client::new(socket);
match client.authenticate(&config_ref).await { match client.authenticate(&config_ref).await {
Ok(_) => { Ok(_) => {
@@ -182,8 +184,9 @@ impl Server {
} }
} }
} }
for (i, packet) in packets { for (i, packet) in packets {
self.parse_packet(i, packet).await? self.parse_packet(i, packet).await?;
} }
// I'm sorry for this code :( // I'm sorry for this code :(