Package freenet.client

Examples of freenet.client.FetchWaiter


        FetchContext context = hlsc.getFetchContext();
        if(desperate) {
          context.maxNonSplitfileRetries = -1;
          context.maxSplitfileBlockRetries = -1;
        }
        FetchWaiter fw = new FetchWaiter(node.nonPersistentClientBulk);

        get = new ClientGetter(fw, uri, context, PluginManager.PRIO, null, null, null);
        try {
          node.clientCore.clientContext.start(get);
        } catch (PersistenceDisabledException e) {
          // Impossible
        }
        FetchResult res = fw.waitForCompletion();
        return res.asBucket().getInputStream();
      } catch (FetchException e) {
        if ((e.getMode() == FetchExceptionMode.PERMANENT_REDIRECT) || (e.getMode() == FetchExceptionMode.TOO_MANY_PATH_COMPONENTS)) {
          uri = e.newURI;
          continue;
View Full Code Here


                continue;
              }
              inserted++;
              try {
                t1 = System.currentTimeMillis();
                FetchWaiter fw = new FetchWaiter(requestContext);
                client.fetch(insertedURIs[j], 32768, fw, fctx);
                fw.waitForCompletion();
                t2 = System.currentTimeMillis();
               
                System.out.println("PULL-TIME FOR BLOCK "+j+": " + (t2 - t1));
                csvLine.add(String.valueOf(t2 - t1));
                pulled++;
View Full Code Here

   * for any two unrelated requests. Request selection round-robin's over these, within any priority and retry count class,
   * and above the level of individual block fetches.
   */
  FetchResult fetch(FreenetURI uri, long maxSize, RequestClient clientContext, FetchContext fctx) throws FetchException {
    // For now, just run it blocking.
    FetchWaiter fw = new FetchWaiter(clientContext);
    @SuppressWarnings("unused")
    ClientGetter getter = client.fetch(uri, 1, fw, fctx);
    return fw.waitForCompletion();

  }
View Full Code Here

      w.flush();
                  return false;
              }
              try {
                FetchContext context = client.getFetchContext();
              FetchWaiter fw = new FetchWaiter((RequestClient)client);
              ClientGetter get = new ClientGetter(fw, uri, context, RequestStarter.INTERACTIVE_PRIORITY_CLASS, null, null, null);
              get.setMetaSnoop(new DumperSnoopMetadata());
                get.start(n.clientCore.clientContext);
          FetchResult result = fw.waitForCompletion();
          ClientMetadata cm = result.getMetadata();
                  outsb.append("Content MIME type: ").append(cm.getMIMEType());
          Bucket data = result.asBucket();
          // FIXME limit it above
          if(data.size() > 32*1024) {
View Full Code Here

TOP

Related Classes of freenet.client.FetchWaiter

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.