garyiscoding commented on issue #310:
URL: https://github.com/apache/mina-sshd/issues/310#issuecomment-1385029023

               long openChannelTimeout = 500L;
               try (ChannelExec channel = session.createExecChannel(command);
                   ByteArrayOutputStream outputStream = new 
ByteArrayOutputStream();
                   ByteArrayOutputStream errorStream = new 
ByteArrayOutputStream()) {
                   channel.setOut(outputStream);
                   channel.setErr(errorStream);
                   channel.open().verify(openChannelTimeout);
                   channel.waitFor(EnumSet.of(CLOSED), execTimeout);
   
                   Integer exitCode = channel.getExitStatus();
                   String outputStr = 
StringUtils.chomp(outputStream.toString());
                   String errorStr = StringUtils.chomp(errorStream.toString());
               }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to