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 volatile int m_recvcellcounter
m_sendcellcounter
private volatile int m_sendcellcounter
m_iSendRelayCellsWaitingForDelivery
private volatile int m_iSendRelayCellsWaitingForDelivery
m_bChannelCreated
private volatile boolean m_bChannelCreated
m_bCreateError
private volatile boolean m_bCreateError
m_oWaitForOpen
private java.lang.Object m_oWaitForOpen
m_oSyncSendCellCounter
private java.lang.Object m_oSyncSendCellCounter
m_oSyncSend
private java.lang.Object m_oSyncSend
m_oSyncSendRelayCellsWaitingForDelivery
private java.lang.Object m_oSyncSendRelayCellsWaitingForDelivery
m_bDoNotCloseChannelOnError
private volatile boolean m_bDoNotCloseChannelOnError
TorChannel
public TorChannel()
addToSendCellCounter
private void addToSendCellCounter(int value)
decreaseSendRelayCellsWaitingForDelivery
protected void decreaseSendRelayCellsWaitingForDelivery()
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
internalClose
private void internalClose()
- Close this channel (called from inside the class) but respecting the doNotCloseOnError flag!
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
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interface AnonChannel
- Overrides:
isClosed
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
setDoNotCloseChannelOnErrorDuringConnect
protected void setDoNotCloseChannelOnErrorDuringConnect(boolean b)
connect
protected boolean connect(java.lang.String addr,
int port)
- connects to a host over the Tor network
- Parameters:
addr
- addressport
- port
- Throws:
ConnectException
dispatchCell
public int 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: