# 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.

##

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

##

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

##

redirector

      public redirector(Socket local,
                        Socket remote)

  redirector gets the streams from sockets

##

couple

      public void couple(redirector c)

  couple this redirector instance with another one (usually the other direction of the connection)

decouple

      public void decouple()

  decouple us from our companion. This will let this redirector die after exiting from run()

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