pub fn host_port_is_busy() -> Option<String> {
    let url = format!("{}:{}", SERVER_HOST.as_str(), SERVER_PORT.as_str());
    let listener = std::net::TcpListener::bind(&url);
    match listener {
        Ok(listener) => {
            drop(listener);
            None
        }
        Err(_err) => Some(url),
    }
}
/// check that this is the only instance of this server
/// return None if the host+port is free
/// if the server host+port is not free, returns the String for the error message.
check that this is the only instance of this server
return None if the host+port is free
if the server host+port is not free, returns the String for the error message.
check that this is the only instance of this server return None if the host + port is free if the server host + port is not free returns the String for the error message .
pub fn host_port_is_busy() -> Option<String> {
    let url = format!("{}:{}", SERVER_HOST.as_str(), SERVER_PORT.as_str());
    let listener = std::net::TcpListener::bind(&url);
    match listener {
        Ok(listener) => {
            drop(listener);
            None
        }
        Err(_err) => Some(url),
    }
}
pub fn host_port_is_busy ( ) -> Option < String > { let url = format ! ( " " SERVER_HOST as_str ( ) SERVER_PORT as_str ( ) ) ; let listener = std :: net :: TcpListener :: bind ( & url ) ; match listener { Ok ( listener ) => { drop ( listener ) ; None } Err ( _err ) => Some ( url ) , } }
check that this is the only instance of this server
return None if the host+port is free
if the server host+port is not free, returns the String for the error message.
check that this is the only instance of this server return None if the host + port is free if the server host + port is not free returns the String for the error message .