Move things to aquatic_common_tcp

This commit is contained in:
Joakim Frostegård 2020-07-02 16:54:27 +02:00
parent 720596dfb4
commit 82378e71f6
8 changed files with 61 additions and 45 deletions

View file

@ -1,5 +1,3 @@
use std::net::SocketAddr;
use serde::{Serialize, Deserialize};
pub use aquatic_common_tcp::config::*;
@ -21,12 +19,12 @@ pub struct Config {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct NetworkConfig {
/// Bind to this address
pub address: SocketAddr,
pub ipv6_only: bool,
#[serde(flatten)]
pub socket: SocketConfig,
#[serde(flatten)]
pub tls: TlsConfig,
pub poll_event_capacity: usize,
@ -34,7 +32,6 @@ pub struct NetworkConfig {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct ProtocolConfig {
@ -66,8 +63,7 @@ impl Default for Config {
impl Default for NetworkConfig {
fn default() -> Self {
Self {
address: SocketAddr::from(([0, 0, 0, 0], 3000)),
ipv6_only: false,
socket: SocketConfig::default(),
tls: TlsConfig::default(),
poll_event_capacity: 4096,
poll_timeout_milliseconds: 50,