(chore) replace flume dependency with std::sync::mpsc (#12)

Co-authored-by: ddidderr <ddidderr@paul.network>
Reviewed-on: #12
This commit is contained in:
2022-04-03 17:34:52 +02:00
parent c67c940ba9
commit 812264e2ab
3 changed files with 4 additions and 237 deletions

View File

@ -1,15 +1,14 @@
use flume::{Receiver, Sender};
use std::sync::mpsc;
use std::net::UdpSocket;
use std::thread::{self, JoinHandle};
mod proto;
use proto::DNSHeader;
fn listen() -> (JoinHandle<()>, Sender<Vec<u8>>, Receiver<Vec<u8>>) {
let (tx, rx) = flume::unbounded();
fn listen() -> (JoinHandle<()>, mpsc::Sender<Vec<u8>>, mpsc::Receiver<Vec<u8>>) {
let (tx, rx) = mpsc::channel();
let tx_clone = tx.clone();
let rx_clone = rx.clone();
(
thread::spawn(move || {
@ -25,7 +24,7 @@ fn listen() -> (JoinHandle<()>, Sender<Vec<u8>>, Receiver<Vec<u8>>) {
}
}),
tx_clone,
rx_clone,
rx,
)
}