Implement TryFrom for DNSOpCode and DNSRCode. (#15)

Co-authored-by: Tobias Ottenweller <tobi@ottenweller.net>
Reviewed-on: #15
This commit is contained in:
2022-04-03 19:03:46 +02:00
committed by ddidderr
parent a07fb80b45
commit cccdf5b5e9
2 changed files with 53 additions and 50 deletions

View File

@ -1,11 +1,15 @@
use std::sync::mpsc;
use std::net::UdpSocket;
use std::sync::mpsc;
use std::thread::{self, JoinHandle};
mod proto;
use proto::DNSHeader;
fn listen() -> (JoinHandle<()>, mpsc::Sender<Vec<u8>>, mpsc::Receiver<Vec<u8>>) {
fn listen() -> (
JoinHandle<()>,
mpsc::Sender<Vec<u8>>,
mpsc::Receiver<Vec<u8>>,
) {
let (tx, rx) = mpsc::channel();
let tx_clone = tx.clone();