From 98474e2329c99aa9caf38159383dbc844fbd20a5 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sun, 24 May 2020 16:22:17 +0800 Subject: [PATCH] UDP associations' default timeout to be 15 seconds ref #262 --- src/relay/udprelay/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/relay/udprelay/mod.rs b/src/relay/udprelay/mod.rs index fead9578..65a45cd2 100644 --- a/src/relay/udprelay/mod.rs +++ b/src/relay/udprelay/mod.rs @@ -71,4 +71,8 @@ mod utils; pub const MAXIMUM_UDP_PAYLOAD_SIZE: usize = 65536; /// Default association expire time -pub const DEFAULT_TIMEOUT: Duration = Duration::from_secs(5 * 60); +/// +/// FIXME: It is very hard to decide how long this value should be. +/// For some usecases, clients may open a socket for sending just one packet, +/// which will eventually cause too many *useless* associations are kept in the server. +pub const DEFAULT_TIMEOUT: Duration = Duration::from_secs(15);