public class DefaultRetransmitter extends Retransmitter
add()
method adds the sequence numbers of messages to be retransmitted. The
remove()
method removes a sequence number again, cancelling retransmission requests for it.
Whenever a message needs to be retransmitted, the RetransmitCommand.retransmit()
method is called.
It can be used e.g. by an ack-based scheme (e.g. AckSenderWindow) to retransmit a message to the receiver, or
by a nak-based scheme to send a retransmission request to the sender of the missing message.Modifier and Type | Class and Description |
---|---|
protected class |
DefaultRetransmitter.SeqnoTask |
Retransmitter.RetransmitCommand, Retransmitter.Task
cmd, log, retransmit_timeouts, sender, timer, xmit_stagger_timeout
Constructor and Description |
---|
DefaultRetransmitter(Address sender,
Retransmitter.RetransmitCommand cmd,
TimeScheduler sched)
Create a new Retransmitter associated with the given sender address
|
Modifier and Type | Method and Description |
---|---|
void |
add(long first_seqno,
long last_seqno)
Add the given range [first_seqno, last_seqno] in the list of
entries eligible for retransmission.
|
void |
remove(long seqno)
Remove the given sequence number from the list of seqnos eligible
for retransmission.
|
void |
remove(long seqno,
boolean remove_all_below)
Removes the given seqno and all seqnos lower than it
|
void |
reset()
Reset the retransmitter: clear all msgs and cancel all the
respective tasks
|
int |
size() |
java.lang.String |
toString() |
getXmitStaggerTimeout, setRetransmitTimeouts, setXmitStaggerTimeout
public DefaultRetransmitter(Address sender, Retransmitter.RetransmitCommand cmd, TimeScheduler sched)
sender
- the address from which retransmissions are expected or to which retransmissions are sentcmd
- the retransmission callback referencesched
- retransmissions schedulerpublic void add(long first_seqno, long last_seqno)
add
in class Retransmitter
public void remove(long seqno)
remove
in class Retransmitter
public void remove(long seqno, boolean remove_all_below)
seqno
- remove_all_below
- If true, all seqnos below seqno are removed, toopublic void reset()
reset
in class Retransmitter
public java.lang.String toString()
toString
in class java.lang.Object
public int size()
size
in class Retransmitter
Copyright © 1998-2020 Red Hat. All Rights Reserved.