I want to control a remote system in Java via SSH using JSCH. The front end is a simple button GUI which triggers the execution of a command. Some of the controls are time critical, there should be no big delay between button press and command execution.
My problem: Every time a new channel is opened, the back-end needs about 8 seconds to initialize until the command is executed. (The back-end interface is implemented with RBSH afaik)
If I run a normal session via a console client, everything runs fine without bigger delays.
My question: Is there a way to initialize a channel to execute some commands and read the output(and only the command output) back sequentially?
I already figured out that session.openChannel("shell")
could give the desired functionality, but I cant figure out how to do that properly.
EDIT: I'm not tied to JSCH. If there's another library which can do that, I'm also open for that