com.mindbright.ssh2
public class SSH2StreamChannel extends SSH2Channel implements NIOCallback
| Modifier and Type | Field and Description |
|---|---|
protected java.io.InputStream |
in |
protected Log |
log |
protected NonBlockingInput |
nbin |
protected NonBlockingOutput |
nbout |
protected java.io.OutputStream |
out |
protected java.lang.Thread |
receiver |
protected long |
rxCounter |
protected Queue |
rxQueue |
protected java.lang.Thread |
transmitter |
protected long |
txCounter |
channelId, channelType, closeListeners, closeReceived, closeSent, connection, creator, deleted, eofReceived, eofSent, openMonitor, openStatus, peerChanId, rxCurrWinSz, rxInitWinSz, rxMaxPktSz, STATUS_CLOSED, STATUS_FAILED, STATUS_OPEN, STATUS_UNDEFINED, txCurrWinSz, txInitWinSz, txMaxPktSz| Modifier | Constructor and Description |
|---|---|
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator) |
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
boolean pty) |
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
java.io.InputStream in,
java.io.OutputStream out)
Create a new stream channel of the given type.
|
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
java.io.InputStream in,
java.io.OutputStream out,
boolean pty) |
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
NonBlockingInput in,
NonBlockingOutput out) |
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
NonBlockingInput in,
NonBlockingOutput out,
boolean pty) |
protected |
SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
java.net.Socket s) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyFilter(SSH2StreamFilter filter)
Apply the given filter to this channel.
|
protected void |
checkRxWindowSize(int len) |
protected void |
closeImpl()
Channel specific handler for the recipent of a channel close message.
|
void |
completed(java.nio.ByteBuffer buf)
Called once the network read operation has been completed
|
void |
connected(boolean timeout)
Called once the connection has been established (assuming
interest for this has been registered by calling the
NotifyWhenConnected method of Switchboard). |
void |
connectionFailed(java.lang.Exception e)
Called if the connection failed (assuming
interest for this has been registered by calling the
NotifyWhenConnected method of Switchboard). |
protected void |
createStreams()
Create the transmitter and receiver threads.
|
protected void |
data(SSH2TransportPDU pdu)
Handle incoming data on the channel.
|
protected void |
eofImpl()
Channel specific handler for the recipent of an EOF.
|
protected void |
handleRequestImpl(java.lang.String type,
boolean wantReply,
SSH2TransportPDU pdu)
Channel specific handler for incoming channel requests.
|
protected void |
openConfirmationImpl(SSH2TransportPDU pdu)
Channel specific handling of open confirmations.
|
protected boolean |
openFailureImpl(int reasonCode,
java.lang.String reasonText,
java.lang.String langTag)
Channel specific handling of open failures.
|
protected void |
outputClosed()
Called when no more data can be written to the channel.
|
void |
readFailed(java.lang.Exception e)
Called if the read failed
|
protected void |
startStreams()
Starts the transmitter and receiver threads.
|
void |
waitUntilClosed() |
void |
waitUntilClosed(int timeout)
Wait until the channel is closed.
|
protected void |
windowAdjustImpl(long inc)
Channel specific implementation of window adjust messages.
|
void |
writeFailed()
Called if the write failed
|
addCloseListener, close, extData, getChannelId, getConnection, getCreator, getPeerId, getType, handleRequest, init, openConfirmation, openFailure, openStatus, recvClose, recvEOF, removeCloseListener, requestFailure, requestSuccess, sendClose, sendEOF, transmit, windowAdjustprotected java.io.InputStream in
protected java.io.OutputStream out
protected NonBlockingInput nbin
protected NonBlockingOutput nbout
protected java.lang.Thread transmitter
protected java.lang.Thread receiver
protected Queue rxQueue
protected long txCounter
protected long rxCounter
protected Log log
protected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator)
protected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
boolean pty)
protected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
java.io.InputStream in,
java.io.OutputStream out)
SSH2Connection and starts with
CH_TYPE.channelType - Type of channel to create.connection - The ssh connection to associate the channel with.creator - The object the channel is created from.in - The input stream from which data to be sent over the
channel is read.out - The output stream onto which data received from the
channel is written.protected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
java.io.InputStream in,
java.io.OutputStream out,
boolean pty)
protected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
java.net.Socket s)
throws java.io.IOException
java.io.IOExceptionprotected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
NonBlockingInput in,
NonBlockingOutput out)
protected SSH2StreamChannel(int channelType,
SSH2Connection connection,
java.lang.Object creator,
NonBlockingInput in,
NonBlockingOutput out,
boolean pty)
public void applyFilter(SSH2StreamFilter filter)
filter - Filter to apply.protected final void checkRxWindowSize(int len)
protected void data(SSH2TransportPDU pdu)
SSH2Channeldata in class SSH2Channelpdu - The data packet.protected void openConfirmationImpl(SSH2TransportPDU pdu)
SSH2ChannelopenConfirmationImpl in class SSH2Channelpdu - Confirmation packet.protected boolean openFailureImpl(int reasonCode,
java.lang.String reasonText,
java.lang.String langTag)
SSH2ChannelopenFailureImpl in class SSH2ChannelreasonCode - Code which tells why the open failed. See the
ssh protocol drafts for values.reasonText - A text explaining why the open failed.langTag - Tag identifying the language of the reason text.protected void windowAdjustImpl(long inc)
SSH2ChannelwindowAdjustImpl in class SSH2Channelinc - The amount to increase the window with.protected void eofImpl()
SSH2ChanneleofImpl in class SSH2Channelprotected void closeImpl()
SSH2ChannelcloseImpl in class SSH2Channelprotected void outputClosed()
protected void handleRequestImpl(java.lang.String type,
boolean wantReply,
SSH2TransportPDU pdu)
SSH2ChannelhandleRequestImpl in class SSH2Channeltype - The type of request.wantReply - True if an reply is expected.pdu - The actual channel request.protected void createStreams()
protected void startStreams()
public void waitUntilClosed(int timeout)
SSH2ChannelwaitUntilClosed in class SSH2Channeltimeout - maximum time to wait in millisecondspublic void waitUntilClosed()
public void completed(java.nio.ByteBuffer buf)
NIOCallbackcompleted in interface NIOCallbackbuf - the buffer provided to the read callpublic void readFailed(java.lang.Exception e)
NIOCallbackreadFailed in interface NIOCallbackpublic void writeFailed()
NIOCallbackwriteFailed in interface NIOCallbackpublic void connected(boolean timeout)
NIOCallbackNotifyWhenConnected method of Switchboard).connected in interface NIOCallbacktimeout - true if the connection attempt timed outpublic void connectionFailed(java.lang.Exception e)
NIOCallbackNotifyWhenConnected method of Switchboard).connectionFailed in interface NIOCallbacke - the exception the connection failed with.