Detecting when SSH connection is lost

43 views
Skip to first unread message

Mario Camou

unread,
Dec 11, 2016, 12:08:31 PM12/11/16
to sshj-users
Hello all,

I am trying to use sshj to open a tunnel to a host via a LocalPortForwarder, and I need to keep it open all the time (reopening if the connection is lost). I haven't been able to detect from my code when that happens. To test, I connect to localhost, create a LocalPortForwarder, and call listen() on it. Then I kill the sshd. I see log messages from sshj, bmy code does not receive any exceptions and listen() does not return.

Any ideas?

Thanks!
-Mario.
Reply all
Reply to author
Forward
0 new messages