public class AckSenderWindow extends java.lang.Object implements Retransmitter.RetransmitCommand
| Modifier and Type | Class and Description |
|---|---|
static interface |
AckSenderWindow.RetransmitCommand |
| Constructor and Description |
|---|
AckSenderWindow(AckSenderWindow.RetransmitCommand com)
Creates a new instance.
|
AckSenderWindow(AckSenderWindow.RetransmitCommand com,
long[] interval) |
AckSenderWindow(AckSenderWindow.RetransmitCommand com,
long[] interval,
TimeScheduler sched) |
AckSenderWindow(AckSenderWindow.RetransmitCommand com,
long[] interval,
TimeScheduler sched,
Address sender) |
| Modifier and Type | Method and Description |
|---|---|
void |
ack(long seqno)
Removes the message from
msgs, removing them also from retransmission. |
void |
add(long seqno,
Message msg)
Adds a new message to the retransmission table.
|
static void |
main(java.lang.String[] args) |
java.lang.String |
printDetails() |
void |
reset() |
void |
retransmit(long first_seqno,
long last_seqno,
Address sender)
Get the missing messages between sequence numbers
first_seqno and last_seqno. |
int |
size() |
java.lang.String |
toString() |
public AckSenderWindow(AckSenderWindow.RetransmitCommand com)
start().com - If not null, its method retransmit() will be called when a message
needs to be retransmitted (called by the Retransmitter).public AckSenderWindow(AckSenderWindow.RetransmitCommand com, long[] interval)
public AckSenderWindow(AckSenderWindow.RetransmitCommand com, long[] interval, TimeScheduler sched)
public AckSenderWindow(AckSenderWindow.RetransmitCommand com, long[] interval, TimeScheduler sched, Address sender)
public void reset()
public void add(long seqno,
Message msg)
window_size messages. If the table is
full, we add all new messages to a queue. Those will only be added once the table drains below a certain
threshold (min_threshold)public void ack(long seqno)
msgs, removing them also from retransmission. If
sliding window protocol is used, and was queueing, check whether we can resume adding elements.
Add all elements. If this goes above window_size, stop adding and back to queueing. Else
set queueing to false.public int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String printDetails()
public void retransmit(long first_seqno,
long last_seqno,
Address sender)
Retransmitter.RetransmitCommandfirst_seqno and last_seqno. This can either be done by sending a
retransmit message to destination sender (nak-based scheme), or by
retransmitting the missing message(s) to sender (ack-based scheme).retransmit in interface Retransmitter.RetransmitCommandfirst_seqno - The sequence number of the first missing messagelast_seqno - The sequence number of the last missing messagesender - The destination of the member to which the retransmit request will be sent
(nak-based scheme), or to which the message will be retransmitted (ack-based scheme).public static void main(java.lang.String[] args)
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.