pub struct Config {
pub name: Option<String>,
pub listener_addr: Option<SocketAddr>,
pub fatal_io_errors: Vec<ErrorKind>,
pub max_connections: u16,
pub connection_timeout_ms: u16,
}
Expand description
The node’s configuration. See the source of Config::default
for the defaults.
Fields§
§name: Option<String>
A user-friendly identifier of the node. It is visible in the logs, where it allows nodes to be distinguished more easily if multiple are run at the same time.
note: If set to None
, the node will automatically be assigned a sequential, zero-based numeric identifier.
listener_addr: Option<SocketAddr>
The socket address the node’s connection listener should bind to.
note: If set to None
, the node will not listen for inbound connections at all.
fatal_io_errors: Vec<ErrorKind>
The list of IO errors considered fatal and causing the connection to be dropped.
note: The node needs to implement the Reading
and/or Writing
protocol in order for it to have any effect.
max_connections: u16
The maximum number of active connections the node can maintain at any given time.
note: This number can very briefly be breached by 1 in case of inbound connection attempts. It can never be breached by outbound connection attempts, though.
connection_timeout_ms: u16
The maximum time (in milliseconds) allowed to establish a raw (before the Handshake
protocol) TCP connection.