File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ use util::vnet::net::*;
6
6
use super :: * ;
7
7
use crate :: error:: * ;
8
8
9
+ /// Default maximum number of retries when allocating a random port in the defined range.
10
+ const DEFAULT_MAX_RETRIES : u16 = 10 ;
11
+
9
12
/// `RelayAddressGeneratorRanges` can be used to only allocate connections inside a defined port range.
10
13
pub struct RelayAddressGeneratorRanges {
11
14
/// `relay_address` is the IP returned to the user when the relay is created.
@@ -48,7 +51,7 @@ impl RelayAddressGenerator for RelayAddressGeneratorRanges {
48
51
requested_port : u16 ,
49
52
) -> Result < ( Arc < dyn Conn + Send + Sync > , SocketAddr ) > {
50
53
let max_retries = if self . max_retries == 0 {
51
- 10
54
+ DEFAULT_MAX_RETRIES
52
55
} else {
53
56
self . max_retries
54
57
} ;
You can’t perform that action at this time.
0 commit comments