fix config over tcp

This commit is contained in:
Guillermo Roche 2022-12-24 13:52:51 +01:00
parent 06816a16ed
commit 0faf0c1773

View File

@ -35,10 +35,10 @@ impl GenericListener {
} }
} }
pub fn bind(address: &String, type_lis: u8) -> Result<Self, String>{ pub fn bind(port: &String, type_lis: u8) -> Result<Self, String>{
let ret = match type_lis { let ret = match type_lis {
TCP_LIS => Self::new_tcp(TcpListener::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(address).unwrap()), UNIX_LIS => Self::new_unix(UnixListener::bind(port).unwrap()),
_ => return Err("No valid option".to_string()), _ => return Err("No valid option".to_string()),
}; };
Ok(ret) Ok(ret)
@ -65,3 +65,4 @@ impl GenericListener {
} }