nat4-nat4 punch (#388)

this patch optimize the udp hole punch logic:

1. allow start punch hole before stun test complete.
2. add lock to symmetric punch, avoid conflict between concurrent hole punching task.
3. support punching hole for predictable nat4-nat4.
4. make backoff of retry reasonable
This commit is contained in:
Sijie.Sun
2024-10-06 22:49:18 +08:00
committed by GitHub
parent ba3da97ad4
commit 37ceb77bf6
24 changed files with 2748 additions and 1310 deletions
+6 -6
View File
@@ -121,14 +121,14 @@ async fn rpc_basic_test() {
// small size req and resp
let ctrl = RpcController {};
let ctrl = RpcController::default();
let input = SayHelloRequest {
name: "world".to_string(),
};
let ret = out.say_hello(ctrl, input).await;
assert_eq!(ret.unwrap().greeting, "Hello world!");
let ctrl = RpcController {};
let ctrl = RpcController::default();
let input = SayGoodbyeRequest {
name: "world".to_string(),
};
@@ -136,7 +136,7 @@ async fn rpc_basic_test() {
assert_eq!(ret.unwrap().greeting, "Goodbye, world!");
// large size req and resp
let ctrl = RpcController {};
let ctrl = RpcController::default();
let name = random_string(20 * 1024 * 1024);
let input = SayGoodbyeRequest { name: name.clone() };
let ret = out.say_goodbye(ctrl, input).await;
@@ -160,7 +160,7 @@ async fn rpc_timeout_test() {
.client
.scoped_client::<GreetingClientFactory<RpcController>>(1, 1, "test".to_string());
let ctrl = RpcController {};
let ctrl = RpcController::default();
let input = SayHelloRequest {
name: "world".to_string(),
};
@@ -199,7 +199,7 @@ async fn standalone_rpc_test() {
.await
.unwrap();
let ctrl = RpcController {};
let ctrl = RpcController::default();
let input = SayHelloRequest {
name: "world".to_string(),
};
@@ -211,7 +211,7 @@ async fn standalone_rpc_test() {
.await
.unwrap();
let ctrl = RpcController {};
let ctrl = RpcController::default();
let input = SayGoodbyeRequest {
name: "world".to_string(),
};