I have an ssh tunnel created with Ganymed's LocalPortForwarder class. It's working fine. The question is how (programmatically in Java) do I check that the tunnel is still open and active?
For reference, here's the code snippet that creates the tunnel (error checking removed for brevity's sake):
Connection conn = new Connection(remoteHostName);
conn.connect();
boolean isAuthenticated = conn.authenticateWithPassword(username, password);
LocalPortForwarder lpf1 = conn.createLocalPortForwarder(newPort, remoteHostName, Integer.parseInt(remoteHostPort));