fn assign_port(mut self) -> Self {
        use rand::Rng;
        let port = loop {
            let port = rand::thread_rng().gen_range(1025..10_000);
            if std::net::TcpListener::bind(("127.0.0.1", port)).is_ok() {
                debug!("This test will use port {}", port);
                break port as u64;
            }
            debug!("Port {} already occupied, looking for another", port);
        };
        self.homeserver.set_host_port(port);
        self
    }
/// Assign a random port for a test.
Assign a random port for a test.
Assign a random port for a test .
fn assign_port(mut self) -> Self {
        use rand::Rng;
        let port = loop {
            let port = rand::thread_rng().gen_range(1025..10_000);
            if std::net::TcpListener::bind(("127.0.0.1", port)).is_ok() {
                debug!("This test will use port {}", port);
                break port as u64;
            }
            debug!("Port {} already occupied, looking for another", port);
        };
        self.homeserver.set_host_port(port);
        self
    }
fn assign_port ( mut self ) -> Self { use rand :: Rng ; let port = loop { let port = rand :: thread_rng ( ) . gen_range ( 1025 .. 10_000 ) ; if std :: net :: TcpListener :: bind ( ( " " , port ) ) . is_ok ( ) { debug ! ( " " port ) ; break port as u64 ; } debug ! ( " " port ) ; } ; self . homeserver . set_host_port ( port ) ; self }
Assign a random port for a test.
Assign a random port for a test .
mut self
mut self