pub struct Config {
pub bind_addr: Vec<SocketAddr>,
pub stream_config: StreamConfig,
pub receive_buffer_size: usize,
pub receive_channel_size: Option<NonZeroUsize>,
}Expand description
Configuration parameters for the reactor.
Fields§
§bind_addr: Vec<SocketAddr>The list of socket addresses where the reactor listens for inbound connections.
stream_config: StreamConfigConfiguration parameters for individual peer connections. This allows the fine tuning of internal buffer sizes etc.
receive_buffer_size: usizeThe size of the shared receive buffer, i.e. the max number of bytes that can be read in one receive operation. Setting this too low can cause many reads to happen, whereas too high a figure will use up more memory and open up your application to DoS attacks. The default is 1 MB.
This figure is capped by Message::MAX_SIZE since there is no need to ever take in more
data in one read than the biggest message requires to decode.
receive_channel_size: Option<NonZeroUsize>Whether the reactor should perform backpressure control on the receive side. Setting this
to Some(n) means that the reactor will start blocking on sending events to the consumer
when the receive channel of size n is full and events are not being read. Setting it to
None means that the capacity of the event channel is unbounded and the reactor will send
events to the consumer as fast as it can, regardless of whether those events are being read
(at all). The default is no backpressure control (None).