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::*;
66use super :: * ;
77use crate :: error:: * ;
88
9+ /// Default maximum number of retries when allocating a random port in the defined range.
10+ const DEFAULT_MAX_RETRIES : u16 = 10 ;
11+
912/// `RelayAddressGeneratorRanges` can be used to only allocate connections inside a defined port range.
1013pub struct RelayAddressGeneratorRanges {
1114 /// `relay_address` is the IP returned to the user when the relay is created.
@@ -48,7 +51,7 @@ impl RelayAddressGenerator for RelayAddressGeneratorRanges {
4851 requested_port : u16 ,
4952 ) -> Result < ( Arc < dyn Conn + Send + Sync > , SocketAddr ) > {
5053 let max_retries = if self . max_retries == 0 {
51- 10
54+ DEFAULT_MAX_RETRIES
5255 } else {
5356 self . max_retries
5457 } ;
You can’t perform that action at this time.
0 commit comments