Package com.subgraph.orchid

Examples of com.subgraph.orchid.ConnectionIOException


    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());
      }
    }
  }
View Full Code Here


  private Cell recvCell() throws ConnectionIOException {
    try {
      return CellImpl.readFromInputStream(input);
    } catch(EOFException e) {
      closeSocket();
      throw new ConnectionIOException();
    } catch (IOException e) {
      if(!isClosed) {
        logger.fine("IOException reading cell from connection "+ this + " : "+ e.getMessage());
        closeSocket();
      }
      throw new ConnectionIOException(e.getClass().getName() + " " + e.getMessage());
    }
  }
View Full Code Here

  Cell readConnectionControlCell() throws ConnectionIOException {
    try {
      return connectionControlCells.take();
    } catch (InterruptedException e) {
      closeSocket();
      throw new ConnectionIOException();
    }
  }
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.ConnectionIOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.