Package freenet.io.xfer.BlockReceiver

Examples of freenet.io.xfer.BlockReceiver.BlockReceiverCompletion


        @Override
        public void run() {
        freenet.support.Logger.OSThread.logPID(this);
          if(logMINOR) Logger.minor(this, "Receiving data for "+CHKInsertHandler.this);
          // Don't log whether the transfer succeeded or failed as the transfer was initiated by the source therefore could be unreliable evidence.
          br.receive(new BlockReceiverCompletion() {
           
            @Override
            public void blockReceived(byte[] buf) {
              if(logMINOR) Logger.minor(this, "Received data for "+CHKInsertHandler.this);
              synchronized(CHKInsertHandler.this) {
View Full Code Here


       
            BlockReceiver br = new BlockReceiver(node.usm, pn, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler, true);
           
             if(logMINOR) Logger.minor(this, "Receiving data (for offer reply)");
             receivingAsync = true;
             br.receive(new BlockReceiverCompletion() {
              
          @Override
          public void blockReceived(byte[] data) {
                synchronized(RequestSender.this) {
                  transferringFrom = null;
View Full Code Here

      final BlockReceiver br = new BlockReceiver(node.usm, next, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler, true);
     
      if(failNow) {
        if(logMINOR) Logger.minor(this, "Terminating forked transfer on "+this+" from "+next);
        prb.abort(RetrievalException.CANCELLED_BY_RECEIVER, "Cancelling fork", true);
        br.receive(new BlockReceiverCompletion() {

        @Override
        public void blockReceived(byte[] buf) {
            if(!wasFork)
              origTag.senderTransferEnds((NodeCHK)key, RequestSender.this);
          next.noLongerRoutingTo(origTag, false);
        }

        @Override
        public void blockReceiveFailed(RetrievalException e) {
            if(!wasFork)
              origTag.senderTransferEnds((NodeCHK)key, RequestSender.this);
          next.noLongerRoutingTo(origTag, false);
        }
         
        });
        return;
      }
     
      if(logMINOR) Logger.minor(this, "Receiving data");
      if(!wasFork) {
        synchronized(this) {
          transferringFrom = next;
        }
      } else
          if(logMINOR) Logger.minor(this, "Receiving data from fork");
     
      receivingAsync = true;
      br.receive(new BlockReceiverCompletion() {
       
        @Override
        public void blockReceived(byte[] data) {
          try {
            long tEnd = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of freenet.io.xfer.BlockReceiver.BlockReceiverCompletion

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.