rabbit.proxy
Class Tunnel

java.lang.Object
  extended by rabbit.proxy.Tunnel

public class Tunnel
extends Object

A handler that just tunnels data.

Author:
Robert Olofsson

Constructor Summary
Tunnel(NioHandler nioHandler, SocketChannel from, BufferHandle fromHandle, TrafficLogger fromLogger, SocketChannel to, BufferHandle toHandle, TrafficLogger toLogger, rabbit.proxy.TunnelDoneListener listener)
          Create a tunnel that transfers data as fast as possible in full duplex.
 
Method Summary
 void start()
          Start tunneling data in both directions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tunnel

public Tunnel(NioHandler nioHandler,
              SocketChannel from,
              BufferHandle fromHandle,
              TrafficLogger fromLogger,
              SocketChannel to,
              BufferHandle toHandle,
              TrafficLogger toLogger,
              rabbit.proxy.TunnelDoneListener listener)
Create a tunnel that transfers data as fast as possible in full duplex.

Parameters:
nioHandler - the NioHandler to use for waiting on data to read as well as waiting for write ready
from - one end of the tunnel
fromHandle - the ByteBuffer holder for the data from "from"
fromLogger - the traffic statistics gatherer for "from"
to - the other end of the tunnel
toHandle - the ByteBuffer holder for the data from "from"
toLogger - the traffic statistics gatherer for "from"
listener - the listener that will be notified when the tunnel is closed
Method Detail

start

public void start()
Start tunneling data in both directions.