public class UnicastFlowControl extends Object implements FlowControl
Max of right edges. No tracking of receivers.
| Modifier and Type | Field and Description |
|---|---|
static UnicastFlowControl |
INSTANCE
Singleton instance which can be used to avoid allocation.
|
| Constructor and Description |
|---|
UnicastFlowControl() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasRequiredReceivers()
Has the flow control strategy its required group of receivers to be considered connected? The
result of this feeds into the determination of if a publication is connected.
|
void |
initialize(MediaDriver.Context context,
CountersManager countersManager,
UdpChannel udpChannel,
int streamId,
int sessionId,
long registrationId,
int initialTermId,
int termBufferLength)
Initialize the flow control strategy for a stream.
|
int |
maxRetransmissionLength(long resendPosition,
int resendLength,
int termBufferLength,
int mtuLength)
The maximum window length allowed to retransmit per NAK.
|
long |
onIdle(long timeNs,
long senderLimit,
long senderPosition,
boolean isEos)
Perform any maintenance needed by the flow control strategy and return current sender limit position.
|
long |
onSetup(SetupFlyweight flyweight,
long senderLimit,
long senderPosition,
int positionBitsToShift,
long timeNs)
Update the sender flow control strategy based on an elicited setup message being sent out.
|
long |
onStatusMessage(StatusMessageFlyweight flyweight,
InetSocketAddress receiverAddress,
long senderLimit,
int initialTermId,
int positionBitsToShift,
long timeNs)
Update the sender flow control strategy based on a status message from the receiver.
|
void |
onTriggerSendSetup(StatusMessageFlyweight flyweight,
InetSocketAddress receiverAddress,
long timeNs)
Update the sender flow control strategy based on a Status Message received triggering a setup to be sent.
|
public static final UnicastFlowControl INSTANCE
public long onStatusMessage(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long senderLimit, int initialTermId, int positionBitsToShift, long timeNs)
onStatusMessage in interface FlowControlflyweight - over the status message received.receiverAddress - of the receiver.senderLimit - the current sender position limit.initialTermId - for the term buffers.positionBitsToShift - in use for the length of each term buffer.timeNs - current time (in nanoseconds).public void onTriggerSendSetup(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long timeNs)
onTriggerSendSetup in interface FlowControlflyweight - over the Status Message receivedreceiverAddress - of the receiver.timeNs - current time (in nanoseconds).public long onSetup(SetupFlyweight flyweight, long senderLimit, long senderPosition, int positionBitsToShift, long timeNs)
onSetup in interface FlowControlflyweight - over the setup to be sent.senderLimit - for the current sender position.senderPosition - which has been sent.positionBitsToShift - in use for the length of each term buffer.timeNs - current time in nanoseconds.public void initialize(MediaDriver.Context context, CountersManager countersManager, UdpChannel udpChannel, int streamId, int sessionId, long registrationId, int initialTermId, int termBufferLength)
initialize in interface FlowControlcontext - to allow access to media driver configurationcountersManager - to use for any counters in use by the strategyudpChannel - for the stream.streamId - for the stream.sessionId - for the stream.registrationId - for the stream.initialTermId - at which the stream started.termBufferLength - to use as the length of each term buffer.public void close()
close in interface FlowControlclose in interface AutoCloseablepublic long onIdle(long timeNs,
long senderLimit,
long senderPosition,
boolean isEos)
onIdle in interface FlowControltimeNs - current time in nanoseconds.senderLimit - for the current sender position.senderPosition - which has been sent.isEos - is this end-of-stream for the sender.public boolean hasRequiredReceivers()
hasRequiredReceivers in interface FlowControlpublic int maxRetransmissionLength(long resendPosition,
int resendLength,
int termBufferLength,
int mtuLength)
maxRetransmissionLength in interface FlowControlresendPosition - of the NAK.resendLength - of the NAK.termBufferLength - of the publication.mtuLength - of the publication.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.