public class SubsystemChannel extends Object
This class provides useful methods for implementing an SSH2 subsystem. Subsystems typically send messages in the following format.
Messages sent using the methods of this class will have the UINT length automatically added and messages received will be unwrapped with just the type and payload being returned. Although subsystems were defined within the SSH2 connection protocol this class takes a single SshChannel as an argument to its constructor which enables subsystems to run over both SSH1 and SSH2 channels.UINT length byte type byte[length-1] payload
| Modifier and Type | Field and Description |
|---|---|
protected SshChannel |
channel |
| Constructor and Description |
|---|
SubsystemChannel(SshChannel channel,
int timeout)
Create a new subsystem channel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the subsystem
|
protected Packet |
createPacket()
Get a packet from the available pool or create if non available
|
protected void |
debug(org.slf4j.Logger log,
String msg,
Object... args) |
protected void |
debug(org.slf4j.Logger log,
String msg,
Throwable e,
Object... args) |
boolean |
isClosed()
Is the subsystem closed?
|
byte[] |
nextMessage()
Read a subsystem message from the channel inputstream.
|
protected void |
sendMessage(Packet msg)
Write a subsystem message to the channel outputstream.
|
protected SshChannel channel
public SubsystemChannel(SshChannel channel, int timeout) throws SshException
channel - SshExceptionpublic boolean isClosed()
public void close()
throws IOException
IOExceptionpublic byte[] nextMessage()
throws SshException
SshExceptionprotected void sendMessage(Packet msg) throws SshException
msg - SshExceptionprotected Packet createPacket() throws IOException
IOExceptionCopyright © 2025. All rights reserved.