fix lockup during holepunch
This commit is contained in:
parent
775aa5add8
commit
9e8ec4db3c
3 changed files with 4 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -4,4 +4,4 @@ version = 3
|
|||
|
||||
[[package]]
|
||||
name = "qft"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue