com.jcraft.jsch.ForwardedTCPIPDaemon Interface Reference

A local deamon process executed when a host connects to to a forwarded port at the remote side. More...

List of all members.

Public Member Functions

void setArg (Object[] arg)
 Sets additional arguments given when the forwarding was created.
void run ()
 Does the actual connection handling.

Package Functions

void setChannel (ChannelForwardedTCPIP channel, InputStream in, OutputStream out)
 Sets the streams to be used for communication.

Detailed Description

A local deamon process executed when a host connects to to a forwarded port at the remote side.

An application should implement this interface if it wants to handle such connections internally instead of forwarding them to another host/port on the local side.

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.

See also:
Session.setPortForwardingR(String, int, String, Object[])

Definition at line 54 of file ForwardedTCPIPDaemon.java.


Member Function Documentation

void com.jcraft.jsch.ForwardedTCPIPDaemon.run (  ) 

Does the actual connection handling.

This method will be run in an own thread (the others will be called from the channel's 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).

void com.jcraft.jsch.ForwardedTCPIPDaemon.setArg ( Object[]  arg  ) 

Sets additional arguments given when the forwarding was created.

Parameters:
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.
See also:
Session.setPortForwardingR(String, int, String, Object[])

Referenced by com.jcraft.jsch.ChannelForwardedTCPIP.run().

void com.jcraft.jsch.ForwardedTCPIPDaemon.setChannel ( ChannelForwardedTCPIP  channel,
InputStream  in,
OutputStream  out 
) [package]

Sets the streams to be used for communication.

This method should not block (or try to read/write from/to these streams), all interaction should be done in the run method.

Parameters:
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.

Referenced by com.jcraft.jsch.ChannelForwardedTCPIP.run().


The documentation for this interface was generated from the following file:

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1