fn connection_listener_run()

in src/enclave_proc/connection_listener.rs [162:189]


    fn connection_listener_run(self, listener: UnixListener) -> NitroCliResult<()> {
        // Accept connections and process them (this is a blocking call).
        for stream in listener.incoming() {
            match stream {
                Ok(stream) => {
                    // Received a new connection. Shut down if required.
                    let cmd = self.handle_new_connection(stream);
                    if let Ok(cmd) = cmd {
                        if cmd == EnclaveProcessCommandType::ConnectionListenerStop {
                            break;
                        }
                    }
                }
                Err(err) => {
                    // Connection failed.
                    warn!("Connection error: {:?}", err);
                    break;
                }
            }
        }

        // Remove the listener's socket.
        self.socket
            .close()
            .map_err(|e| e.add_subaction("Failed to close socket".to_string()))?;
        debug!("Connection listener has finished.");
        Ok(())
    }