mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
use builder to spawn thread for packet stream
This commit is contained in:
@@ -53,7 +53,10 @@ pub fn parse_packets(
|
||||
let mut first_packet_ticks = None;
|
||||
|
||||
let (pcap_tx, pcap_rx) = std::sync::mpsc::channel();
|
||||
thread::spawn(move || packet_stream(cap, &pcap_tx));
|
||||
let _ = thread::Builder::new()
|
||||
.name("thread_packet_stream".to_string())
|
||||
.spawn(move || packet_stream(cap, &pcap_tx))
|
||||
.log_err(location!());
|
||||
|
||||
loop {
|
||||
let (packet_res, cap_stats) = pcap_rx
|
||||
|
||||
Reference in New Issue
Block a user