From d9588a5dfbf9e8d351d63ad6ae81bf26861bef15 Mon Sep 17 00:00:00 2001 From: Yujia Qiao Date: Tue, 8 Mar 2022 22:12:32 +0800 Subject: [PATCH] fix: update keepalive params --- README.md | 8 ++++---- src/transport/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0795265b..00fd73d4 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ type = "tcp" # Optional. Possible values: ["tcp", "tls", "noise"]. Default: "tcp [client.transport.tcp] # Optional proxy = "socks5://user:passwd@127.0.0.1:1080" # Optional. Use the proxy to connect to the server nodelay = false # Optional. Determine whether to enable TCP_NODELAY, if applicable, to improve the latency but decrease the bandwidth. Default: false -keepalive_secs = 10 # Optional. Specify `tcp_keepalive_time` in `tcp(7)`, if applicable. Default: 10 seconds -keepalive_interval = 5 # Optional. Specify `tcp_keepalive_intvl` in `tcp(7)`, if applicable. Default: 5 seconds +keepalive_secs = 20 # Optional. Specify `tcp_keepalive_time` in `tcp(7)`, if applicable. Default: 20 seconds +keepalive_interval = 8 # Optional. Specify `tcp_keepalive_intvl` in `tcp(7)`, if applicable. Default: 8 seconds [client.transport.tls] # Necessary if `type` is "tls" trusted_root = "ca.pem" # Necessary. The certificate of CA that signed the server's certificate @@ -142,8 +142,8 @@ heartbeat_interval = 30 # Optional. Set to 0 to disable the heartbeat. Default: [server.transport] # Same as `[client.transport]` type = "tcp" nodelay = false -keepalive_secs = 10 -keepalive_interval = 5 +keepalive_secs = 20 +keepalive_interval = 8 [server.transport.tls] # Necessary if `type` is "tls" pkcs12 = "identify.pfx" # Necessary. pkcs12 file of server's certificate and private key diff --git a/src/transport/mod.rs b/src/transport/mod.rs index 9dd09f21..cc0e139f 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -11,8 +11,8 @@ use tracing::{error, trace}; pub const DEFAULT_NODELAY: bool = false; -pub const DEFAULT_KEEPALIVE_SECS: u64 = 10; -pub const DEFAULT_KEEPALIVE_INTERVAL: u64 = 3; +pub const DEFAULT_KEEPALIVE_SECS: u64 = 20; +pub const DEFAULT_KEEPALIVE_INTERVAL: u64 = 8; /// Specify a transport layer, like TCP, TLS #[async_trait]