Package com.subgraph.orchid

Examples of com.subgraph.orchid.Stream


    final int requestEventCode = purposeToEventCode(purpose, false);
    final int loadingEventCode = purposeToEventCode(purpose, true);
   
    notifyInitialization(requestEventCode);

    final Stream stream = circuit.openDirectoryStream(OPEN_DIRECTORY_STREAM_TIMEOUT, true);
    notifyInitialization(loadingEventCode);
    return stream;
  }
View Full Code Here


      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) {
View Full Code Here

  }
 
  private HSDescriptor downloadDescriptorFrom(HSDescriptorDirectory dd) {
    logger.fine("Downloading descriptor from "+ dd.getDirectory());
   
    Stream stream = null;
    try {
      stream = openHSDirectoryStream(dd.getDirectory());
      HttpConnection http = new HttpConnection(stream);
      http.sendGetRequest("/tor/rendezvous2/"+ dd.getDescriptorId().toBase32());
      http.readResponse();
      if(http.getStatusCode() == 200) {
        return readDocument(dd, http.getMessageBody());
      } else {
        logger.fine("HS descriptor download for "+ hiddenService.getOnionAddressForLogging() + " failed with status "+ http.getStatusCode());
      }
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return null;
    } catch (TimeoutException e) {
      logger.fine("Timeout downloading HS descriptor from "+ dd.getDirectory());
      e.printStackTrace();
      return null;
    } catch (IOException e) {
      logger.info("IOException downloading HS descriptor from "+ dd.getDirectory() +" : "+ e);
      return null;
    } catch (OpenFailedException e) {
      logger.info("Failed to open stream to HS directory "+ dd.getDirectory() +" : "+ e.getMessage());
      return null;
    } catch (DirectoryRequestFailedException e) {
      logger.info("Directory request to HS directory "+ dd.getDirectory() + " failed "+ e.getMessage());
      return null;
    } finally {
      if(stream != null) {
        stream.close();
        stream.getCircuit().markForClose();
      }
    }
   
    return null;
   
View Full Code Here

        request.sendError(true);
        return;
      }
     
      try {
        final Stream stream = openConnectStream(request);
        logger.fine("SOCKS CONNECT to "+ request.getTarget()+ " completed");
        request.sendSuccess();
        runOpenConnection(stream);
      } catch (InterruptedException e) {
        logger.info("SOCKS CONNECT to "+ request.getTarget() + " was thread interrupted");
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.Stream

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.