end server config parametrization
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user