Package com.subgraph.orchid

Examples of com.subgraph.orchid.DirectoryCircuit


    final int requestEventCode = purposeToEventCode(purpose, false);
    final int loadingEventCode = purposeToEventCode(purpose, true);
   
    int failCount = 0;
    while(failCount < OPEN_DIRECTORY_STREAM_RETRY_COUNT) {
      final DirectoryCircuit circuit = openDirectoryCircuit();
      if(requestEventCode > 0) {
        initializationTracker.notifyEvent(requestEventCode);
      }
      try {
        final Stream stream = circuit.openDirectoryStream(OPEN_DIRECTORY_STREAM_TIMEOUT, true);
        if(loadingEventCode > 0) {
          initializationTracker.notifyEvent(loadingEventCode);
        }
        return stream;
      } catch (StreamConnectFailedException e) {
        circuit.markForClose();
        failCount += 1;
      } catch (TimeoutException e) {
        circuit.markForClose();
      }
    }
    throw new OpenFailedException("Retry count exceeded opening directory stream");
  }
View Full Code Here


  }

  public DirectoryCircuit openDirectoryCircuit() throws OpenFailedException {
    int failCount = 0;
    while(failCount < OPEN_DIRECTORY_STREAM_RETRY_COUNT) {
      final DirectoryCircuit circuit = CircuitImpl.createDirectoryCircuit(this);
      if(tryOpenCircuit(circuit, true, true)) {
        return circuit;
      }
      failCount += 1;
    }
View Full Code Here

    ConsensusDocument consensus = directory.getCurrentConsensusDocument();
    return (consensus != null) && (consensus.getUseNTorHandshake());
  }

  public DirectoryCircuit openDirectoryCircuitTo(List<Router> path) throws OpenFailedException {
    final DirectoryCircuit circuit = CircuitImpl.createDirectoryCircuitTo(this, path);
    if(!tryOpenCircuit(circuit, true, false)) {
      throw new OpenFailedException("Could not create directory circuit for path");
    }
    return circuit;
  }
View Full Code Here

  private Stream openHSDirectoryStream(Router directory) throws TimeoutException, InterruptedException, OpenFailedException {

    final InternalCircuit circuit = circuitManager.getCleanInternalCircuit();
   
    try {
      final DirectoryCircuit dc = circuit.cannibalizeToDirectory(directory);
      return dc.openDirectoryStream(10000, true);
    } catch (StreamConnectFailedException e) {
      circuit.markForClose();
      throw new OpenFailedException("Failed to open directory stream");
    } catch (TorException e) {
      circuit.markForClose();
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.DirectoryCircuit

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.