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 { } +