public class RemoteForwardingChannel<T extends SshContext> extends SocketForwardingChannel<T> implements ClientConnector
Implements a Remote forwarding channel for use with forwarding sockets from the server machine through the client to some endpoint reachable from the client machine.
Channel.QueuedData
Modifier and Type | Field and Description |
---|---|
static String |
LOCAL_TYPE |
static String |
REMOTE_TYPE |
static String |
X11_TYPE |
key, selectorThread, socketChannel
hostToConnect, originatingHost, originatingPort, portToConnect
connection, localwindow, localWindowLock
Modifier | Constructor and Description |
---|---|
protected |
RemoteForwardingChannel() |
|
RemoteForwardingChannel(String addressToBind,
int portToBind,
SocketChannel socketChannel)
Constructs a forwarding channel of the type "forwarded-tcpip"
|
|
RemoteForwardingChannel(String name,
String addressToBind,
int portToBind,
SocketChannel socketChannel) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
createChannel()
Creates the end of the channel open message string address that was
connected uint32 port that was connected string originator IP address
uint32 originator port
|
boolean |
finishConnect(SelectionKey key)
Called when the forwarded socket has been connected.
|
void |
initialize(ProtocolEngine engine,
SshEngine daemon)
No initialization is necessary so this method does nothing.
|
protected void |
onChannelOpenConfirmation()
Called when the channel has been confirmed as open by the remote side -
this method is only called when the channel has been requested by this
side of the connection
|
protected void |
onChannelOpenFailure()
Either nothing was listening on the clients end of the tunnel, or the
connection was rejected.
|
protected void |
onRegistrationComplete()
Called by the subsystem when the selector registration has been
completed.
|
protected void |
onRemoteEOF()
Called when the remote side is EOF.
|
protected byte[] |
openChannel(byte[] requestdata)
Called when the channel is being opened.
|
canClose, canClose, evaluateClosure, evaluateWindowSpace, getInterestedOps, onChannelClosed, onChannelClosing, onChannelData, onChannelFree, onChannelOpen, onChannelRequest, onExtendedData, onLocalEOF, onRemoteClose, onWindowAdjust, processReadEvent, processWriteEvent, registrationCompleted, run, setSelectionKey, setThread, shutdownSocket
getHost, getOriginatingHost, getOriginatingPort, getPort
addEventListener, addInputListener, addOutputListener, clearIdleState, close, getChannelType, getConnection, getConnectionProtocol, getContext, getLocalId, getLocalPacket, getLocalWindow, getQueueSize, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, isClosed, isClosing, isEOF, isLocalEOF, isOpen, isRemoteEOF, processChannelRequestResponse, queueSize, registerExtendedData, resetIdleState, sendChannelData, sendChannelData, sendChannelData, sendChannelData, sendChannelDataAndBlock, sendChannelRequest, sendEOF, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjust
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
registrationCompleted
public static final String LOCAL_TYPE
public static final String REMOTE_TYPE
public static final String X11_TYPE
public RemoteForwardingChannel(String addressToBind, int portToBind, SocketChannel socketChannel)
addressToBind
- StringportToBind
- intsocketChannel
- SocketChannelprotected RemoteForwardingChannel()
public RemoteForwardingChannel(String name, String addressToBind, int portToBind, SocketChannel socketChannel)
name
- addressToBind
- portToBind
- socketChannel
- protected byte[] createChannel() throws IOException
createChannel
in class SocketForwardingChannel<T extends SshContext>
IOException
protected void onRemoteEOF()
onRemoteEOF
in class SocketForwardingChannel<T extends SshContext>
protected void onRegistrationComplete()
SocketForwardingChannel
onRegistrationComplete
in class SocketForwardingChannel<T extends SshContext>
protected void onChannelOpenConfirmation()
Channel
onChannelOpenConfirmation
in class SocketForwardingChannel<T extends SshContext>
protected byte[] openChannel(byte[] requestdata) throws WriteOperationRequest, ChannelOpenException
Channel
openChannel
in class SocketForwardingChannel<T extends SshContext>
WriteOperationRequest
ChannelOpenException
public boolean finishConnect(SelectionKey key)
finishConnect
in interface ClientConnector
key
- SelectionKeyprotected void onChannelOpenFailure()
onChannelOpenFailure
in class Channel<T extends SshContext>
public void initialize(ProtocolEngine engine, SshEngine daemon)
SocketForwardingChannel
initialize
in interface SocketHandler
initialize
in class SocketForwardingChannel<T extends SshContext>
engine
- ProtocolEnginedaemon
- DaemonCopyright © 2016. All rights reserved.