Struct openssh_mux_client::Connection
source · pub struct Connection { /* private fields */ }
Expand description
§Cancel safety
All methods of this struct is not cancellation safe.
Implementations§
source§impl Connection
impl Connection
pub async fn connect<P: AsRef<Path>>(path: P) -> Result<Self>
sourcepub async fn send_alive_check(&mut self) -> Result<NonZeroU32>
pub async fn send_alive_check(&mut self) -> Result<NonZeroU32>
Send a ping to the server and return pid of the ssh mux server if it is still alive.
sourcepub async fn open_new_session(
self,
session: &Session<'_>,
fds: &[RawFd; 3],
) -> Result<EstablishedSession>
pub async fn open_new_session( self, session: &Session<'_>, fds: &[RawFd; 3], ) -> Result<EstablishedSession>
Opens a new session.
Consumes self
so that users would not be able to create multiple sessions
or perform other operations during the session that might complicates the
handling of packets received from the ssh mux server.
Two additional cases that the client must cope with are it receiving a signal itself (from the ssh mux server) and the server disconnecting without sending an exit message.
fds
- must be in blocking mode
sourcepub async fn sftp(self, fds: &[RawFd; 3]) -> Result<EstablishedSession>
pub async fn sftp(self, fds: &[RawFd; 3]) -> Result<EstablishedSession>
Convenient function for opening a new sftp session, uses
open_new_session
underlying.
sourcepub async fn request_port_forward(
&mut self,
forward_type: ForwardType,
listen_socket: &Socket<'_>,
connect_socket: &Socket<'_>,
) -> Result<()>
pub async fn request_port_forward( &mut self, forward_type: ForwardType, listen_socket: &Socket<'_>, connect_socket: &Socket<'_>, ) -> Result<()>
Request for local/remote port forwarding.
sourcepub async fn close_port_forward(
&mut self,
forward_type: ForwardType,
listen_socket: &Socket<'_>,
connect_socket: &Socket<'_>,
) -> Result<()>
pub async fn close_port_forward( &mut self, forward_type: ForwardType, listen_socket: &Socket<'_>, connect_socket: &Socket<'_>, ) -> Result<()>
Request for local/remote port forwarding closure.
sourcepub async fn request_dynamic_forward(
&mut self,
listen_socket: &Socket<'_>,
) -> Result<NonZeroU32>
pub async fn request_dynamic_forward( &mut self, listen_socket: &Socket<'_>, ) -> Result<NonZeroU32>
UNTESTED Return remote port opened for dynamic forwarding.
sourcepub async fn request_stop_listening(&mut self) -> Result<()>
pub async fn request_stop_listening(&mut self) -> Result<()>
Request the master to stop accepting new multiplexing requests and remove its listener socket.
sourcepub fn request_stop_listening_sync(self) -> Result<()>
pub fn request_stop_listening_sync(self) -> Result<()>
Request the master to stop accepting new multiplexing requests and remove its listener socket.
Only suitable to use in Drop::drop
.