From 0faf0c1773fe340c30ea5540f0de9baa0c90979e Mon Sep 17 00:00:00 2001 From: Guillermo Roche Date: Sat, 24 Dec 2022 13:52:51 +0100 Subject: [PATCH] fix config over tcp --- src/server_conf/listener.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server_conf/listener.rs b/src/server_conf/listener.rs index bbc18cf..324632e 100644 --- a/src/server_conf/listener.rs +++ b/src/server_conf/listener.rs @@ -35,10 +35,10 @@ impl GenericListener { } } - pub fn bind(address: &String, type_lis: u8) -> Result{ + pub fn bind(port: &String, type_lis: u8) -> Result{ let ret = match type_lis { - TCP_LIS => Self::new_tcp(TcpListener::bind(address).unwrap()), - UNIX_LIS => Self::new_unix(UnixListener::bind(address).unwrap()), + TCP_LIS => Self::new_tcp(TcpListener::bind(String::from("0.0.0.0:") + port).unwrap()), + UNIX_LIS => Self::new_unix(UnixListener::bind(port).unwrap()), _ => return Err("No valid option".to_string()), }; Ok(ret) @@ -65,3 +65,4 @@ impl GenericListener { } +