1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#[derive(Debug, Clone)]
pub struct NodeConfig {
pub name: Option<String>,
pub desired_listening_port: Option<u16>,
pub allow_random_port: bool,
pub reading_handler_queue_depth: usize,
pub writing_handler_queue_depth: usize,
pub conn_read_buffer_size: usize,
pub conn_write_buffer_size: usize,
pub conn_inbound_queue_depth: usize,
pub conn_outbound_queue_depth: usize,
pub invalid_message_penalty_secs: u64,
pub max_connections: u16,
}
impl Default for NodeConfig {
fn default() -> Self {
Self {
name: None,
desired_listening_port: None,
allow_random_port: true,
reading_handler_queue_depth: 16,
writing_handler_queue_depth: 16,
conn_read_buffer_size: 64 * 1024,
conn_write_buffer_size: 64 * 1024,
conn_inbound_queue_depth: 256,
conn_outbound_queue_depth: 16,
invalid_message_penalty_secs: 10,
max_connections: 100,
}
}
}