Package freenet.io.xfer

Examples of freenet.io.xfer.PacketThrottle


      return;
    int rt = (int) Math.min(rtt, Integer.MAX_VALUE);
    pn.reportPing(rt);
    if(validAck)
      pn.receivedAck(ackReceived);
    PacketThrottle throttle = pn.getThrottle();
    if(throttle == null)
      return;
    throttle.setRoundTripTime(rt);
    if(validAck)
      throttle.notifyOfPacketAcknowledged(maxSize);
  }
View Full Code Here


      }
    }
    if(count > 0 && logMINOR)
      Logger.minor(this, "" + count + " packets in flight with threshold " + maxDelay + "ms");
    if(bigLostCount != 0 && pn != null) {
      PacketThrottle throttle = pn.getThrottle();
      if(throttle != null) {
        throttle.notifyOfPacketsLost(bigLostCount);
      }
      pn.backoffOnResend();
    }
  }
View Full Code Here

      }

    }
   
    if(tracker != null && pn != null) {
      PacketThrottle throttle = pn.getThrottle();
      if(throttle == null) {
        // Ignore
      } else {
        int maxPackets = (int)Math.min(Integer.MAX_VALUE, pn.getThrottle().getWindowSize());
        // Impose a minimum so that we don't lose the ability to send anything.
View Full Code Here

      long received = peerNodeStatus.getTotalInputBytes();
      peerRow.addChild("td", "class", "peer-idle" /* FIXME */).addChild("#", SizeUtil.formatSize(received)+" / "+SizeUtil.formatSize(sent)+"/"+SizeUtil.formatSize(resent)+" ("+fix1.format(((double)resent) / ((double)sent))+")");
      // total traffic column startup
      peerRow.addChild("td", "class", "peer-idle" /* FIXME */).addChild("#", SizeUtil.formatSize(peerNodeStatus.getTotalInputSinceStartup())+" / "+SizeUtil.formatSize(peerNodeStatus.getTotalOutputSinceStartup()));
      // congestion control
      PacketThrottle t = peerNodeStatus.getThrottle();
      String val;
      if(t == null)
        val = "none";
      else
        val = (int)t.getBandwidth()+"B/sec delay "+
          t.getDelay()+"ms (RTT "+t.getRoundTripTime()+"ms window "+t.getWindowSize()+')';
      peerRow.addChild("td", "class", "peer-idle" /* FIXME */).addChild("#", val);
      // time delta
      peerRow.addChild("td", "class", "peer-idle" /* FIXME */).addChild("#", TimeUtil.formatTime(peerNodeStatus.getClockDelta()));
      peerRow.addChild("td", "class", "peer-idle" /* FIXME */).addChild("#", peerNodeStatus.getReportedUptimePercentage()+"%");
      peerRow.addChild("td", "class", "peer-idle" /* FIXME */).addChild("#", SizeUtil.formatSize(peerNodeStatus.getMessageQueueLengthBytes())+":"+TimeUtil.formatTime(peerNodeStatus.getMessageQueueLengthTime()));
View Full Code Here

      if(tellDisconnect != null)
        for(MessageItem item : tellDisconnect) {
          item.onDisconnect();
        }
    }
    PacketThrottle throttle;
    synchronized(this) {
      throttle = _lastThrottle;
    }
    if(throttle != null) throttle.maybeDisconnected();
    Logger.normal(this, "Completed handshake with " + this + " on " + replyTo + " - current: " + currentTracker +
      " old: " + previousTracker + " unverified: " + unverifiedTracker + " bootID: " + thisBootID + (bootIDChanged ? "(changed) " : "") + " for " + shortToString());

    setPeerNodeStatus(now);
View Full Code Here

 
  /** @return The largest throttle window size of any of our throttles.
   * This is just for guesstimating how many blocks we can have in flight. */
  @Override
  public int getThrottleWindowSize() {
    PacketThrottle throttle = getThrottle();
    if(throttle != null) return (int)(Math.min(throttle.getWindowSize(), Integer.MAX_VALUE));
    else return Integer.MAX_VALUE;
  }
View Full Code Here

TOP

Related Classes of freenet.io.xfer.PacketThrottle

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.