public interface CongestionControl extends AutoCloseable
Modifier and Type | Field and Description |
---|---|
static int |
FORCE_STATUS_MESSAGE_BIT |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
initialWindowLength()
Called by
DriverConductor to initialise window length for a new PublicationImage . |
void |
onRttMeasurement(long nowNs,
long rttNs,
InetSocketAddress srcAddress)
Called by
Receiver on reception of an RTT Measurement. |
void |
onRttMeasurementSent(long nowNs)
Called by
Receiver to record that a measurement request has been sent. |
long |
onTrackRebuild(long nowNs,
long newConsumptionPosition,
long lastSmPosition,
long hwmPosition,
long startingRebuildPosition,
long endingRebuildPosition,
boolean lossOccurred)
Called by
DriverConductor upon execution of PublicationImage.trackRebuild(long, long) to
pass on current status. |
static long |
packOutcome(int receiverWindowLength,
boolean forceStatusMessage)
Pack values into a long so they can be returned on the stack without allocation.
|
static int |
receiverWindowLength(long outcome)
Extract the receiver window length from the packed value.
|
static boolean |
shouldForceStatusMessage(long outcome)
Extract the boolean value for if a status message should be forced from the packed value.
|
boolean |
shouldMeasureRtt(long nowNs)
Polled by
Receiver to determine when to initiate an RTT measurement to a Sender. |
static int |
threshold(int windowLength)
Threshold increment in a window after which a status message should be scheduled.
|
static final int FORCE_STATUS_MESSAGE_BIT
static long packOutcome(int receiverWindowLength, boolean forceStatusMessage)
receiverWindowLength
- to go in the lower bits.forceStatusMessage
- to go in the higher bits.static int receiverWindowLength(long outcome)
outcome
- as the packed value.static boolean shouldForceStatusMessage(long outcome)
outcome
- which is packed containing the force status message flag.static int threshold(int windowLength)
windowLength
- to calculate the threshold from.boolean shouldMeasureRtt(long nowNs)
Receiver
to determine when to initiate an RTT measurement to a Sender.nowNs
- in nanosecondsvoid onRttMeasurementSent(long nowNs)
Receiver
to record that a measurement request has been sent.nowNs
- in nanoseconds.void onRttMeasurement(long nowNs, long rttNs, InetSocketAddress srcAddress)
Receiver
on reception of an RTT Measurement.nowNs
- in nanosecondsrttNs
- to the Sender in nanosecondssrcAddress
- of the Senderlong onTrackRebuild(long nowNs, long newConsumptionPosition, long lastSmPosition, long hwmPosition, long startingRebuildPosition, long endingRebuildPosition, boolean lossOccurred)
DriverConductor
upon execution of PublicationImage.trackRebuild(long, long)
to
pass on current status.
The return value must be packed using packOutcome(int, boolean)
.
nowNs
- current timenewConsumptionPosition
- of the subscriberslastSmPosition
- of the imagehwmPosition
- of the imagestartingRebuildPosition
- of the rebuildendingRebuildPosition
- of the rebuildlossOccurred
- during rebuildint initialWindowLength()
DriverConductor
to initialise window length for a new PublicationImage
.void close()
close
in interface AutoCloseable
Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.