public synchronized boolean sendNoop() throws GenericFileOperationFailedException { if (isConnected()) { try { session.sendKeepAliveMsg(); return true; } catch (Exception e) { LOG.debug("SFTP session was closed. Ignoring this exception.", e); return false; } } return false; }
private void keepAlive() throws IOException { try { channel.getSession().sendKeepAliveMsg(); } catch (Exception e) { // can't be less generic as sendKeepAliveMsg declares to throw Exception throw asIOException(e); } }
/** * Wait until it's done and return its code. * @param exec The channel * @return The exit code * @throws IOException If some IO problem inside */ @SuppressWarnings("PMD.AvoidCatchingGenericException") private int code(final ChannelExec exec) throws IOException { while (!exec.isClosed()) { try { this.session.sendKeepAliveMsg(); // @checkstyle IllegalCatch (1 line) } catch (final Exception ex) { throw new IOException(ex); } try { TimeUnit.SECONDS.sleep(1L); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IOException(ex); } } return exec.getExitStatus(); } }
/** * Wait until it's done and return its code. * @param exec The channel * @return The exit code * @throws IOException If some IO problem inside */ @SuppressWarnings("PMD.AvoidCatchingGenericException") private int code(final ChannelExec exec) throws IOException { while (!exec.isClosed()) { try { this.session.sendKeepAliveMsg(); // @checkstyle IllegalCatch (1 line) } catch (final Exception ex) { throw new IOException(ex); } try { TimeUnit.SECONDS.sleep(1L); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IOException(ex); } } return exec.getExitStatus(); } }
private boolean isConnected() { if (channel.isConnected()) { try { channel.getSession().sendKeepAliveMsg(); return true; } catch (@SuppressWarnings("unused") Exception e) { // the keep alive failed - treat as not connected, and actually disconnect quietly disconnectQuietly(); } } return false; }
sendKeepAliveMsg(); stimeout++; continue;
} catch (InterruptedIOException/*SocketTimeoutException*/ ee) { if (!in_kex && stimeout < serverAliveCountMax) { sendKeepAliveMsg(); stimeout++; continue;
sendKeepAliveMsg(); stimeout++; continue;
sendKeepAliveMsg(); stimeout++; continue;
sendKeepAliveMsg(); stimeout++; continue;