Class redirector

Class redirector

java.lang.Object
   |
   +----redirector

class redirector
extends Object
implements Runnable
A class useful for the proxy server. This class takes over control of newly created connections and redirects the data streams.

Constructor Index

 o redirector(Socket, Socket)
redirector gets the streams from sockets

Method Index

 o couple(redirector)
couple this redirector instance with another one (usually the other direction of the connection)
 o decouple()
decouple us from our companion.
 o run()
read data from the input and write it to the destination stream until an error occurs or our companion is decoupled from us

Constructors

 o redirector
  public redirector(Socket local,
                    Socket remote)
redirector gets the streams from sockets

Methods

 o couple
  public void couple(redirector c)
couple this redirector instance with another one (usually the other direction of the connection)
 o decouple
  public void decouple()
decouple us from our companion. This will let this redirector die after exiting from run()
 o run
  public void run()
read data from the input and write it to the destination stream until an error occurs or our companion is decoupled from us