Struct uflow::EndpointConfig
source · pub struct EndpointConfig {
pub max_send_rate: usize,
pub max_receive_rate: usize,
pub max_packet_size: usize,
pub max_receive_alloc: usize,
pub keepalive: bool,
pub keepalive_interval_ms: u64,
pub active_timeout_ms: u64,
}
Expand description
Parameters used to configure either endpoint of a uflow
connection.
Fields§
§max_send_rate: usize
The maximum send rate, in bytes per second. The endpoint will ensure that its outgoing bandwidth does not exceed this value.
Must be greater than 0. Values larger than 2^32 will be truncated.
max_receive_rate: usize
The maximum acceptable receive rate, in bytes per second. The opposing endpoint will ensure that its outgoing bandwidth does not exceed this value.
Must be greater than 0. Values larger than 2^32 will be truncated.
max_packet_size: usize
The maximum size of a sent packet, in bytes. The endpoint will ensure that it does not send packets with a size exceeding this value.
Must be greater than 0, and less than or equal to MAX_PACKET_SIZE
.
max_receive_alloc: usize
The maximum allocation size of the endpoint’s receive buffer, in bytes. The endpoint will
ensure that the total amount of memory allocated to receive packet data doesn’t exceed this
value, rounded up to the nearest multiple of
MAX_FRAGMENT_SIZE
.
Must be greater than 0.
Note: The maximum allocation size necessarily constrains the maximum receivable packet
size. A connection attempt will fail if the max_packet_size
of the opposing endpoint
exceeds this value.
keepalive: bool
Whether the endpoint should automatically send keepalive frames if no data has been sent
for one keepalive interval (see keepalive_interval_ms
). If set to false, one endpoint
must continually send data to avoid causing a timeout on the opposite host.
keepalive_interval_ms: u64
The interval in milliseconds at which keepalive frames are sent.
Note: Keepalive frames will not be sent faster than the connection RTO (computed according to TFRC) or 2s, whichever is longer.
active_timeout_ms: u64
Time in milliseconds after which an active connection will terminate if no frames have been received from the remote endpoint.
Implementations§
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