pub async fn send_iac(&mut self, command: TelnetEvent) -> Result<TelnetEvent> {
        self.frame.send(command).await?;

        let response = match self.frame.next().await {
            Some(Ok(response)) => response,
            Some(Err(e)) => {
                tracing::error!(%e, "Error sending IAC");
                return Err(Error {
                    kind: ErrorType::Internal,
                    message: e.to_string(),
                });
            }
            None => {
                tracing::error!("No response from IAC");
                return Err(Error {
                    kind: ErrorType::Internal,
                    message: "No response from IAC".to_string(),
                });
            }
        };

        Ok(response)
    }
/// Sends a Telnet IAC (Interpret As Command) message to the client and records
/// their response.
Sends a Telnet IAC (Interpret As Command) message to the client and records
their response.
Sends a Telnet IAC ( Interpret As Command ) message to the client and records their response .
pub async fn send_iac(&mut self, command: TelnetEvent) -> Result<TelnetEvent> {
        self.frame.send(command).await?;
        let response = match self.frame.next().await {
            Some(Ok(response)) => response,
            Some(Err(e)) => {
                tracing::error!(%e, "Error sending IAC");
                return Err(Error {
                    kind: ErrorType::Internal,
                    message: e.to_string(),
                });
            }
            None => {
                tracing::error!("No response from IAC");
                return Err(Error {
                    kind: ErrorType::Internal,
                    message: "No response from IAC".to_string(),
                });
            }
        };
        Ok(response)
    }
pub async fn send_iac ( & mut self , command : TelnetEvent ) -> Result < TelnetEvent > { self . frame . send ( command ) . await ? ; let response = match self . frame . next ( ) . await { Some ( Ok ( response ) ) => response , Some ( Err ( e ) ) => { tracing :: error ! ( e " " ) ; return Err ( Error { kind : ErrorType :: Internal , message : e . to_string ( ) , } ) ; } None => { tracing :: error ! ( " " ) ; return Err ( Error { kind : ErrorType :: Internal , message : " " . to_string ( ) , } ) ; } } ; Ok ( response ) }
Sends a Telnet IAC (Interpret As Command) message to the client and records
their response.
Sends a Telnet IAC ( Interpret As Command ) message to the client and records their response .
&mut self
command
TelnetEvent
&mut self
command
TelnetEvent