public class ConnectionImpl extends Object implements Connection, DashboardRenderable
DASHBOARD_CIRCUITS, DASHBOARD_CONNECTIONS, DASHBOARD_CONNECTIONS_VERBOSE, DASHBOARD_PREDICTED_PORTS, DASHBOARD_STREAMS| Constructor and Description |
|---|
ConnectionImpl(TorConfig config,
SSLSocket socket,
Router router,
TorInitializationTracker tracker,
boolean isDirectoryConnection) |
| Modifier and Type | Method and Description |
|---|---|
int |
bindCircuit(Circuit circuit)
Choose an available circuit id value and bind this Circuit to that id value, returning the id value.
|
void |
dashboardRender(DashboardRenderer renderer,
PrintWriter writer,
int flags) |
Router |
getRouter()
Return the
Router associated with this connection. |
boolean |
isClosed()
Return
true if the socket for this connection has been closed. |
void |
removeCircuit(Circuit circuit)
Remove a Circuit which has been bound to this Connection by a previous call to
bindCircuit. |
void |
sendCell(Cell cell)
Send a protocol
Cell on this connection. |
String |
toString() |
public ConnectionImpl(TorConfig config, SSLSocket socket, Router router, TorInitializationTracker tracker, boolean isDirectoryConnection)
public Router getRouter()
ConnectionRouter associated with this connection.getRouter in interface Connectionpublic boolean isClosed()
Connectiontrue if the socket for this connection has been closed. Otherwise, false.isClosed in interface Connectiontrue if this connection is closed or false otherwise.public int bindCircuit(Circuit circuit)
ConnectionCircuit.deliverRelayCell(Cell)
and other cells will be delivered with Circuit.deliverControlCell(Cell).bindCircuit in interface Connectioncircuit - The Circuit to bind to this connection.public void sendCell(Cell cell) throws ConnectionIOException
ConnectionCell on this connection.sendCell in interface Connectioncell - The Cell to transfer.ConnectionIOException - If the cell could not be send because the connection is not connected
or if an error occured while sending the cell data.public void removeCircuit(Circuit circuit)
ConnectionbindCircuit.
After removing a Circuit, any further received incoming cells for the Circuit will be discarded.removeCircuit in interface Connectioncircuit - The Circuit to remove.public void dashboardRender(DashboardRenderer renderer, PrintWriter writer, int flags) throws IOException
dashboardRender in interface DashboardRenderableIOExceptionCopyright © 2015. All rights reserved.