From ba014f2895657c2907c55086225080705c6819d2 Mon Sep 17 00:00:00 2001 From: EAimTY Date: Sat, 30 Jul 2022 23:30:22 +0900 Subject: [PATCH] try to fix #75 --- server/src/connection/udp.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/src/connection/udp.rs b/server/src/connection/udp.rs index 023c71c..3aa5a14 100644 --- a/server/src/connection/udp.rs +++ b/server/src/connection/udp.rs @@ -136,10 +136,12 @@ impl UdpSession { let (send_pkt_tx, send_pkt_rx) = mpsc::channel(1); tokio::spawn(async move { - match tokio::select!( - res = Self::listen_send_packet(socket.clone(), send_pkt_rx) => res, - res = Self::listen_receive_packet(socket, assoc_id, recv_pkt_tx,max_pkt_size) => res, - ) { + let res = tokio::select! { + res = tokio::spawn(Self::listen_send_packet(socket.clone(), send_pkt_rx)) => res, + res = tokio::spawn(Self::listen_receive_packet(socket, assoc_id, recv_pkt_tx, max_pkt_size)) => res, + }; + + match res.unwrap() { Ok(()) => (), Err(err) => log::warn!("[{src_addr}] [udp-session] [{assoc_id}] {err}"), }