增加线程名称

This commit is contained in:
lubeilin
2023-03-30 12:09:12 +08:00
parent 8d76214193
commit 5dcda4d088
5 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ use crate::protocol::error_packet::InErrorPacket;
use crate::tun_device::TunWriter;
pub fn start(mut handler: RecvHandler) {
thread::spawn(move || {
thread::Builder::new().name("udp-recv-handler".into()).spawn(move || {
let mut buf = [0; 4096];
loop {
match handler.channel.recv_from(&mut buf, None) {
@@ -48,7 +48,7 @@ pub fn start(mut handler: RecvHandler) {
}
}
}
});
}).unwrap();
}
pub struct RecvHandler {