mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
move back SocketConfig to aquatic_http
This commit is contained in:
parent
82378e71f6
commit
b86787ef20
5 changed files with 18 additions and 31 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::net::SocketAddr;
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
pub use aquatic_common_tcp::config::*;
|
||||
|
|
@ -19,12 +21,12 @@ pub struct Config {
|
|||
}
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct NetworkConfig {
|
||||
#[serde(flatten)]
|
||||
pub socket: SocketConfig,
|
||||
/// Bind to this address
|
||||
pub address: SocketAddr,
|
||||
pub ipv6_only: bool,
|
||||
#[serde(flatten)]
|
||||
pub tls: TlsConfig,
|
||||
pub poll_event_capacity: usize,
|
||||
|
|
@ -63,7 +65,8 @@ impl Default for Config {
|
|||
impl Default for NetworkConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
socket: SocketConfig::default(),
|
||||
address: SocketAddr::from(([0, 0, 0, 0], 3000)),
|
||||
ipv6_only: false,
|
||||
tls: TlsConfig::default(),
|
||||
poll_event_capacity: 4096,
|
||||
poll_timeout_milliseconds: 50,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ pub fn run_socket_worker(
|
|||
response_channel_receiver: ResponseChannelReceiver,
|
||||
opt_tls_acceptor: Option<TlsAcceptor>,
|
||||
){
|
||||
match create_listener(&config.network.socket){
|
||||
match create_listener(config.network.address, config.network.ipv6_only){
|
||||
Ok(listener) => {
|
||||
socket_worker_statuses.lock()[socket_worker_index] = Some(Ok(()));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue