INNER CODE UNIT · Rust

state

ekzhang/sshx · crates/sshx-server/src/lib.rs:65

    pub fn state(&self) -> Arc<ServerState> {
        Arc::clone(&self.state)
    }

    /// Run the application server, listening on a stream of connections.
    pub async fn listen<L>(&self, listener: L) -> Result<()>
    where
        L: Listener,
        L::Addr: Debug,
    {
        let state = self.state.clone();
        let terminated = self.shutdown.wait();
        tokio::spawn(async move {
            let background_tasks = futures_util::future::join(
                state.listen_for_transfers(),
                state.close_old_sessions(),
            );
            tokio::select! {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…