public interface ForwardedTCPIPDaemon extends Runnable
All implementations should provide a no-argument constructor, as this one is used when creating an instance.
When someone connects to the remote socket, we create an instance using
the no-argument constructor, then call
setChannel
(with the streams connected to the
remote socket) and setArg
with the arguments given
when the channel was created. Then we create a new Thread executing the
run()
method.
Modifier and Type | Method and Description |
---|---|
void |
run()
Does the actual connection handling.
|
void |
setArg(Object[] arg)
Sets additional arguments given when the forwarding was created.
|
void |
setChannel(ChannelForwardedTCPIP channel,
InputStream in,
OutputStream out)
Sets the streams to be used for communication.
|
void setChannel(ChannelForwardedTCPIP channel, InputStream in, OutputStream out)
run()
method.channel
- the channel connected to the remote socket.
This object may be used to disconnect, for example.in
- all data arriving from the remote socket can be read
from this stream.out
- all data written to this stream will be sent to the
remote socket.void setArg(Object[] arg)
arg
- arguments to be used by the deamon, the meaning is application
specific. We should not change this array, as all subsequent
daemons for this same port forwarding will be affected.Session.setPortForwardingR(String, int, String, Object[])
void run()
connect()
) and should close the channel
at the end (otherwise we will have a dangling connection, if the
remote client host does not close it).This is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.