pre-allocate buffer mem to receive packet
pre-allocate recv_from return value
@@ -243,11 +243,10 @@ impl DNSConn {
) -> Result<(), Error> {
log::info!("enter loop and listening {:?}", socket.local_addr());
- loop {
let mut b = vec![0u8; INBOUND_BUFFER_SIZE];
+ let (mut n, mut src);
- let (n, src);
-
+ loop {
tokio::select! {
_ = closed_rx.recv() => {
log::info!("Closing server connection");
