Struct quinn_proto::EndpointConfig
source · pub struct EndpointConfig { /* private fields */ }
Expand description
Global configuration for the endpoint, affecting all connections
Default values should be suitable for most internet applications.
Implementations§
source§impl EndpointConfig
impl EndpointConfig
sourcepub fn new(reset_key: Arc<dyn HmacKey>) -> Self
pub fn new(reset_key: Arc<dyn HmacKey>) -> Self
Create a default config with a particular reset_key
sourcepub fn cid_generator<F: Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync + 'static>(
&mut self,
factory: F
) -> &mut Self
pub fn cid_generator<F: Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync + 'static>( &mut self, factory: F ) -> &mut Self
Supply a custom connection ID generator factory
Called once by each Endpoint
constructed from this configuration to obtain the CID
generator which will be used to generate the CIDs used for incoming packets on all
connections involving that Endpoint
. A custom CID generator allows applications to embed
information in local connection IDs, e.g. to support stateless packet-level load balancers.
EndpointConfig::new()
applies a default random CID generator factory. This functions
accepts any customized CID generator to reset CID generator factory that implements
the ConnectionIdGenerator
trait.
sourcepub fn reset_key(&mut self, key: Arc<dyn HmacKey>) -> &mut Self
pub fn reset_key(&mut self, key: Arc<dyn HmacKey>) -> &mut Self
Private key used to send authenticated connection resets to peers who were communicating with a previous instance of this endpoint.
sourcepub fn max_udp_payload_size(
&mut self,
value: u16
) -> Result<&mut Self, ConfigError>
pub fn max_udp_payload_size( &mut self, value: u16 ) -> Result<&mut Self, ConfigError>
Maximum UDP payload size accepted from peers (excluding UDP and IP overhead).
Must be greater or equal than 1200.
Defaults to 1472, which is the largest UDP payload that can be transmitted in the typical 1500 byte Ethernet MTU. Deployments on links with larger MTUs (e.g. loopback or Ethernet with jumbo frames) can raise this to improve performance at the cost of a linear increase in datagram receive buffer size.
sourcepub fn supported_versions(&mut self, supported_versions: Vec<u32>) -> &mut Self
pub fn supported_versions(&mut self, supported_versions: Vec<u32>) -> &mut Self
Override supported QUIC versions
sourcepub fn grease_quic_bit(&mut self, value: bool) -> &mut Self
pub fn grease_quic_bit(&mut self, value: bool) -> &mut Self
Whether to accept QUIC packets containing any value for the fixed bit
Enabled by default. Helps protect against protocol ossification and makes traffic less identifiable to observers. Disable if helping observers identify this traffic as QUIC is desired.
Trait Implementations§
source§impl Clone for EndpointConfig
impl Clone for EndpointConfig
source§fn clone(&self) -> EndpointConfig
fn clone(&self) -> EndpointConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more