return new InetSocketAddress(address, router.getOnionPort());
}
public void sendCell(Cell cell) throws ConnectionIOException {
if(!socket.isConnected()) {
throw new ConnectionIOException("Cannot send cell because connection is not connected");
}
updateLastActivity();
synchronized(output) {
try {
output.write(cell.getCellBytes());
} catch (IOException e) {
logger.fine("IOException writing cell to connection "+ e.getMessage());
closeSocket();
throw new ConnectionIOException(e.getClass().getName() + " : "+ e.getMessage());
}
}
}