connect_and_exec Method
Connects to an SSH server and executes a command in one go.
Syntax
def connect_and_exec(address: str, port: int, command: str, want_stdout: bool, want_std_err: bool) -> bytes: ...
Remarks
Use this method to connect to an SSH server at Address and Port and execute a command. The method returns the output of the executed command.
This method is a handy shortcut for running non-interactive commands. It encapsulates calls to connect, receive, disconnect internally to save you time and space.
Please note that on_connect_and_exec always runs synchronously, thus ignoring the async_mode setting.