Package freenet.node.NewPacketFormat

Examples of freenet.node.NewPacketFormat.SentPacket


    long rtt;
    int maxSize;
    boolean validAck = false;
    long ackReceived = System.currentTimeMillis();
    if(logDEBUG) Logger.debug(this, "Acknowledging packet "+ack+" from "+pn);
    SentPacket sent;
    synchronized(sentPackets) {
      sent = sentPackets.remove(ack);
      maxSize = (maxSeenInFlight * 2) + 10;
    }
    if(sent != null) {
      rtt = sent.acked(key);
      validAck = true;
    } else {
      if(logDEBUG) Logger.debug(this, "Already acked or lost "+ack);
      long packetSent = lostSentTimes.queryAndRemove(ack);
      if(packetSent < 0) {
View Full Code Here


    }
  }

  public void sent(int sequenceNumber, int length) {
    synchronized(sentPackets) {
      SentPacket sentPacket = sentPackets.get(sequenceNumber);
      if(sentPacket != null) sentPacket.sent(length);
    }
  }
View Full Code Here

   
    synchronized(sentPackets) {
      Iterator<Map.Entry<Integer, SentPacket>> it = sentPackets.entrySet().iterator();
      while(it.hasNext()) {
        Map.Entry<Integer, SentPacket> e = it.next();
        SentPacket s = e.getValue();
        if (s.getSentTime() < threshold) {
          if (logMINOR) {
            Logger.minor(this, "Assuming packet " + e.getKey() + " has been lost. "
                            + "Delay " + (curTime - s.getSentTime()) + "ms, "
                            + "threshold " + threshold + "ms");
          }
          // Store the packet sentTime in our lost sent times cache, so we can calculate
          // RTT if an ack may surface later on.
          if(!s.messages.isEmpty()) {
                lostSentTimes.report(e.getKey(), s.getSentTime());
              }
              // Mark the packet as lost and remove it from our active packets.
              s.lost();
          it.remove();
          bigLostCount++;
        } else {
          count++;
        }
View Full Code Here

TOP

Related Classes of freenet.node.NewPacketFormat.SentPacket

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.