Пример #1
0
 public void retransmit(SeqnoList missing, Address sender) {
   Unicast2Header hdr = Unicast2Header.createXmitReqHeader();
   Message retransmit_msg = new Message(sender, null, missing);
   retransmit_msg.setFlag(Message.OOB);
   if (log.isTraceEnabled())
     log.trace(local_addr + ": sending XMIT_REQ (" + missing + ") to " + sender);
   retransmit_msg.putHeader(this.id, hdr);
   down_prot.down(new Event(Event.MSG, retransmit_msg));
   xmit_reqs_sent.addAndGet(missing.size());
 }
Пример #2
0
  protected void handleXmitRequest(Address sender, SeqnoList missing) {
    if (log.isTraceEnabled())
      log.trace(
          new StringBuilder()
              .append(local_addr)
              .append(" <-- XMIT(")
              .append(sender)
              .append(": #")
              .append(missing)
              .append(')'));

    SenderEntry entry = send_table.get(sender);
    xmit_reqs_received.addAndGet(missing.size());
    Table<Message> win = entry != null ? entry.sent_msgs : null;
    if (win != null) {
      for (long seqno : missing) {
        Message msg = win.get(seqno);
        if (msg == null) {
          if (log.isWarnEnabled() && !local_addr.equals(sender)) {
            StringBuilder sb = new StringBuilder();
            sb.append("(requester=").append(sender).append(", local_addr=").append(this.local_addr);
            sb.append(") message ").append(sender).append("::").append(seqno);
            sb.append(" not found in retransmission table of ")
                .append(sender)
                .append(":\n")
                .append(win);
            log.warn(sb.toString());
          }
          continue;
        }

        down_prot.down(new Event(Event.MSG, msg));
        xmit_rsps_sent.incrementAndGet();
      }
    }
  }