public class FirstOnionRouterConnection
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private boolean |
m_bIsClosed |
private boolean |
m_bRun |
private java.util.Hashtable |
m_Circuits |
private ORDescriptor |
m_description |
private long |
m_inittimeout |
private java.io.InputStream |
m_istream |
private RSAKeyPair |
m_keypairIdentityKey |
private java.lang.Object |
m_oSendSync |
private java.io.OutputStream |
m_ostream |
private MyRandom |
m_rand |
private java.lang.Thread |
m_readDataLoop |
private TinyTLS |
m_tinyTLS |
private Tor |
m_Tor |
private static java.lang.String |
OP_NAME |
Constructor and Description |
---|
FirstOnionRouterConnection(ORDescriptor d,
Tor a_Tor)
constructor
creates a FOR from the description
|
Modifier and Type | Method and Description |
---|---|
void |
close()
closes the connection to the onionrouter
|
private void |
closedByPeer()
connection was closed by peer
|
void |
connect()
connects to the FOR
|
Circuit |
createCircuit(java.util.Vector onionRouters)
Creates a circuit with the given onion routers
|
private boolean |
dispatchCell(Cell cell)
dispatches a cell to the circuits if one is recieved
|
ORDescriptor |
getORDescription()
returns the description of the onion router
|
boolean |
isClosed()
check if the connection to the first onion router is closed
|
protected void |
notifyCircuitClosed(Circuit circ) |
void |
run()
dispatches cells while the thread, started with start is running
|
void |
send(Cell cell)
sends a cell
|
private void |
start()
starts the thread that reads from the inputstream and dispatches the cells
|
private void |
stop()
stops the thread that dispatches cells
|
private static java.lang.String OP_NAME
private TinyTLS m_tinyTLS
private ORDescriptor m_description
private java.lang.Thread m_readDataLoop
private java.io.InputStream m_istream
private java.io.OutputStream m_ostream
private java.util.Hashtable m_Circuits
private volatile boolean m_bRun
private boolean m_bIsClosed
private MyRandom m_rand
private java.lang.Object m_oSendSync
private long m_inittimeout
private Tor m_Tor
private RSAKeyPair m_keypairIdentityKey
public FirstOnionRouterConnection(ORDescriptor d, Tor a_Tor)
d
- description of the onion routera_Tor
- a tor instancepublic ORDescriptor getORDescription()
public boolean isClosed()
public void send(Cell cell) throws java.io.IOException
cell
- cell with datajava.io.IOException
private boolean dispatchCell(Cell cell)
cell
- Cell to dispatchpublic void connect() throws java.lang.Exception
java.lang.Exception
public Circuit createCircuit(java.util.Vector onionRouters)
onionRouters
- vector that contains a list of onion routersprivate void start()
public void run()
run
in interface java.lang.Runnable
private void stop() throws java.io.IOException
java.io.IOException
public void close()
private void closedByPeer()
protected void notifyCircuitClosed(Circuit circ)
Copyright © 2023. All rights reserved.