public class RetransmitHandler
extends java.lang.Object
A max number of retransmits is permitted by Configuration.MAX_RETRANSMITS_DEFAULT
. Additional received NAKs
will be ignored if this maximum is reached.
Constructor and Description |
---|
RetransmitHandler(org.agrona.concurrent.NanoClock nanoClock,
SystemCounters systemCounters,
FeedbackDelayGenerator delayGenerator,
FeedbackDelayGenerator lingerTimeoutGenerator)
Create a retransmit handler.
|
Modifier and Type | Method and Description |
---|---|
void |
onNak(int termId,
int termOffset,
int length,
int termLength,
RetransmitSender retransmitSender)
Called on reception of a NAK to start retransmits handling.
|
void |
onRetransmitReceived(int termId,
int termOffset)
Called to indicate a retransmission is received that may obviate the need to send one ourselves.
|
void |
processTimeouts(long nowNs,
RetransmitSender retransmitSender)
Called to process any outstanding timeouts.
|
public RetransmitHandler(org.agrona.concurrent.NanoClock nanoClock, SystemCounters systemCounters, FeedbackDelayGenerator delayGenerator, FeedbackDelayGenerator lingerTimeoutGenerator)
nanoClock
- used to determine timesystemCounters
- for recording significant events.delayGenerator
- to use for delay determinationlingerTimeoutGenerator
- to use for linger timeoutpublic void onNak(int termId, int termOffset, int length, int termLength, RetransmitSender retransmitSender)
termId
- from the NAK and the term id of the buffer to retransmit fromtermOffset
- from the NAK and the offset of the data to retransmitlength
- of the missing datatermLength
- of the term buffer.retransmitSender
- to call if an immediate retransmit is requiredpublic void onRetransmitReceived(int termId, int termOffset)
NOTE: Currently only called from unit tests. Would be used for retransmitting from receivers for NAK suppression
termId
- of the datatermOffset
- of the datapublic void processTimeouts(long nowNs, RetransmitSender retransmitSender)
nowNs
- time in nanosecondsretransmitSender
- to call on retransmissionsCopyright © 2014-2018 Real Logic Ltd. All Rights Reserved.