anon.tor
Class TorChannel
java.lang.Object
anon.shared.AbstractChannel
anon.tor.TorChannel
- All Implemented Interfaces:
- AnonChannel
- Direct Known Subclasses:
- TorSocksChannel
public class TorChannel
- extends AbstractChannel
- Author:
- stefan
Methods inherited from class java.lang.Object |
clone, equals, getClass, notify, notifyAll, toString, wait, wait, wait |
MAX_CELL_DATA
private static final int MAX_CELL_DATA
- See Also:
- Constant Field Values
m_circuit
protected Circuit m_circuit
m_recvcellcounter
private int m_recvcellcounter
m_sendcellcounter
private int m_sendcellcounter
m_oWaitForOpen
private java.lang.Object m_oWaitForOpen
TorChannel
public TorChannel()
setStreamID
protected void setStreamID(int id)
setCircuit
protected void setCircuit(Circuit c)
getOutputBlockSize
public int getOutputBlockSize()
- Description copied from interface:
AnonChannel
- Returns a value that indicates the current optimum size of data to write.. Because often
anon services transport the data splited into packets for optimum performance
it may be good to send data according to the packet size to avoid unneccessary overheads.
- Returns:
- the current optimum size for output data. If 1 is returned the size does not matter.
send
protected void send(byte[] arg0,
int len)
throws java.io.IOException
- Specified by:
send
in class AbstractChannel
- Throws:
java.io.IOException
close
public void close()
- Description copied from interface:
AnonChannel
- Closes the channel and releases all resources used.
- Specified by:
close
in interface AnonChannel
- Overrides:
close
in class AbstractChannel
closedByPeer
public void closedByPeer()
- Overrides:
closedByPeer
in class AbstractChannel
close_impl
protected void close_impl()
- Specified by:
close_impl
in class AbstractChannel
connect
public boolean connect(java.lang.String addr,
int port)
- connects to a host over the tor-network
- Parameters:
addr
- addressport
- port
- Throws:
ConnectException
dispatchCell
public void dispatchCell(RelayCell cell)
- dispatches the cells to the outputstream
- Parameters:
cell
- cell
isClosedByPeer
public boolean isClosedByPeer()
- gets if the connection was closed by peer
- Returns: