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,3 +1,5 @@
use std::net::SocketAddr;
use serde::{Serialize, Deserialize};
@ -29,6 +31,14 @@ pub struct HandlerConfig {
pub channel_recv_timeout_microseconds: u64,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct SocketConfig {
/// Bind to this address
pub address: SocketAddr,
pub ipv6_only: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
@ -73,6 +83,16 @@ impl Default for HandlerConfig {
}
impl Default for SocketConfig {
fn default() -> Self {
Self {
address: SocketAddr::from(([0, 0, 0, 0], 3000)),
ipv6_only: false,
}
}
}
impl Default for TlsConfig {
fn default() -> Self {
Self {