Skip to content

Commit

Permalink
Add some comments for 1148118271#91
Browse files Browse the repository at this point in the history
  • Loading branch information
HsuJv committed Dec 26, 2023
1 parent e19fd29 commit d792865
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ impl SessionBuilder {
}

/// Read/Write timeout for local SSH mode. Use None to disable timeout.
/// This is a global timeout only take effect after the session is established
///
/// Use `connect_with_timeout` instead if you want to add timeout
/// when connect to the target SSH server
pub fn timeout(mut self, timeout: Option<Duration>) -> Self {
self.config.timeout = timeout;
self
Expand Down Expand Up @@ -241,6 +245,8 @@ impl SessionBuilder {
self
}

/// Create a TCP connection to the target server
///
pub fn connect<A>(self, addr: A) -> SshResult<SessionConnector<TcpStream>>
where
A: ToSocketAddrs,
Expand All @@ -257,6 +263,8 @@ impl SessionBuilder {
self.connect_bio(tcp)
}

/// Create a TCP connection to the target server, with timeout provided
///
pub fn connect_with_timeout<A>(
self,
addr: A,
Expand Down

0 comments on commit d792865

Please sign in to comment.