}
public void run() {
- SshSession session;
- try {
- session = sshClient.openSession();
- } catch (IOException e) {
- logger.error("Cannot establish session", e);
- sshClient.close();
- return;
- }
try {
+ SshSession session = sshClient.openSession();
invoker.invoke(session);
InputStream stdOut = session.getStdout();
session.getStderr();
} catch (VirtualSocketException e) {
// Netty closed connection prematurely.
+ // Or maybe tried to open ganymed connection without having initialized session
+ // (ctx.channel().remoteAddress() is null)
// Just pass and move on.
} catch (Exception e) {
logger.error("Unexpected exception", e);
private void writeImpl(ByteBuf message) throws IOException {
message.getBytes(0, stdIn, message.readableBytes());
+ message.release();
stdIn.flush();
}