Skip to content

Commit

Permalink
Merge branch 'main' into feature/implement-oss-parent
Browse files Browse the repository at this point in the history
  • Loading branch information
NassimBtk authored Jul 15, 2024
2 parents 1a85ff9 + 8d43b48 commit 1193eb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@

<groupId>org.sentrysoftware</groupId>
<artifactId>ssh</artifactId>
<version>1.1.00-SNAPSHOT</version>

<name>SSH Java Client</name>
<version>1.0.02-SNAPSHOT</version>
<description>SSH Cilent Library for Java</description>

<organization>
Expand Down
17 changes: 14 additions & 3 deletions src/main/java/org/sentrysoftware/ssh/SshClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,24 @@ public void connect() throws IOException {
}

/**
* Connects the SSH Client to the SSH server
* Connects the SSH client to the SSH server using the default SSH port (22).
*
* @param timeout Timeout in milliseconds
* @throws IOException when connection fails or when the server does not respond (SocketTimeoutException)
*/
public void connect(final int timeout) throws IOException {
this.connect(timeout, 22);
}

/**
* Connects the SSH client to the SSH server using a specified SSH port.
*
* @param timeout Timeout in milliseconds
* @param port SSH server port.
* @throws IOException when connection fails or when the server does not respond (SocketTimeoutException)
*/
public void connect(int timeout) throws IOException {
sshConnection = new Connection(hostname);
public void connect(final int timeout, final int port) throws IOException {
sshConnection = new Connection(hostname, port);
sshConnection.connect(null, timeout, timeout);
}

Expand Down

0 comments on commit 1193eb9

Please sign in to comment.