I am having similar issue as reported by this user under review.
user: Taabish
I am facing problem with the J2ssh library in my application where it get hangs very often.
import com.sshtools.j2ssh.SshClient;
import com.sshtools.j2ssh.authentication.AuthenticationProtocolState;
import com.sshtools.j2ssh.authentication.PasswordAuthenticationClient;
import com.sshtools.j2ssh.session.SessionChannelClient;
ssh = new SshClient(); ssh.setSocketTimeout(10000);
ssh.connect(hostname, port); --->> It gets stuck at this point.
PasswordAuthenticationClient pwd = new PasswordAuthenticationClient();
pwd.setUsername(username);
pwd.setPassword(password);
result = ssh.authenticate(pwd);
I believe the setSocketTimeout is not throwing any exception.
Can anyone please provide me with a solution. Thanks