fix lockup during holepunch

This commit is contained in:
Daniella / Tove 2022-08-13 17:03:42 +02:00
parent 775aa5add8
commit 9e8ec4db3c
3 changed files with 4 additions and 2 deletions

2
Cargo.lock generated
View file

@ -4,4 +4,4 @@ version = 3
[[package]]
name = "qft"
version = "0.1.4"
version = "0.1.5"

View file

@ -1,6 +1,6 @@
[package]
name = "qft"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -326,6 +326,8 @@ fn holepunch(args: &Vec<String>) -> UdpSocket {
.connect(SocketAddrV4::from_str(bind_addr.as_str()).unwrap())
.expect("connection failed");
println!("Waiting...");
holepunch.set_read_timeout(Some(Duration::from_secs(1))).unwrap();
holepunch.set_write_timeout(Some(Duration::from_secs(1))).unwrap();
let mut stop = false;
while !stop {
let m = unix_millis();