channel.addListener(new Channel.Listener() {
@Override
public void onClosed(Channel channel, IOException cause) {
LOGGER.fine("Terminating ping thread for " + channel);
isInClosed.set(true);
t.interrupt(); // make sure the ping thread is terminated
}
});
t.start();
LOGGER.fine("Ping thread started for " + channel + " with a " + interval + " minute interval");