end server config parametrization

This commit is contained in:
2022-12-23 20:55:28 +01:00
parent 930a1a3692
commit 06816a16ed
3 changed files with 41 additions and 23 deletions

View File

@@ -10,10 +10,11 @@ pub struct ConfSer{
}
impl ConfSer {
fn new(path: String) -> ConfSer{
fn new(path: &String, conf_type: &String) -> ConfSer{
ConfSer{
path: path.clone(),
listener: GenericListener::bind(path, 1).unwrap(),
listener: GenericListener::bind(path,
GenericListener::string_top_type(conf_type)).unwrap(),
}
}
}
@@ -27,7 +28,8 @@ impl Drop for ConfSer {
}
pub fn start(conf: Arc<RwLock<conf::Config>>){
let ser = ConfSer::new(String::from("mineproxy"));
let ser = ConfSer::new(conf.read().unwrap().get_port_conf()
,conf.read().unwrap().get_conf_type());
loop{
match ser.listener.accept() {