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
- SshException
public boolean isClosed()
public void close() throws IOException
IOException
public byte[] nextMessage() throws SshException
SshException
protected void sendMessage(Packet msg) throws SshException
msg
- SshException
protected Packet createPacket() throws IOException
IOException
Copyright © 2024. All rights reserved.