//! This module contains the configuration for the server and the nodes.
//! Usually code for the server and the node is shared.
/// This data structure contains the configuration for the server and the node.
#[derive(Debug, Clone)]pubstructNCConfiguration{/// IP address of the server, default: 127.0.0.1
pubaddress: String,
/// Port used by the server, default: 9000.
pubport:u16,
/// Nodes have to send a heartbeat every n seconds or they will be marked as offline.
/// (The method [`heartbeat_timeout(node_id)`](crate::nc_server::NCServer::heartbeat_timeout)
/// with the corresponding node ID is called), default: 5.
pubheartbeat:u64,
/// Nodes will wait n seconds before contacting the server again to prevent a denial of service, default: 60.
pubdelay_request_data:u64,
/// Number of times a node should try to contact the server before givin up, default: 5.
pubretry_counter:u64,
/// The number of threads in the thread pool, default: 8.
pubpool_size:u64,
}implDefault forNCConfiguration{fndefault()->Self{
NCConfiguration {
address:"127.0.0.1".to_string(),
port:9000,
heartbeat:60,
delay_request_data:60,
retry_counter:5,
pool_size:8}}}