public final class NetworkPublication extends Object implements RetransmitSender, DriverManagedResource, Subscribable
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscriber(SubscriptionLink subscriptionLink,
ReadablePosition position)
Add a subscriber and its position used for tracking consumption.
|
String |
channel()
Channel URI string for this publication.
|
void |
close()
Close resources that are not external.
|
boolean |
free()
Free external resources such as files.
|
boolean |
hasReachedEndOfLife()
Has resource reached end of its life and should be reclaimed?
|
void |
onNak(int termId,
int termOffset,
int length)
Process a NAK message so a retransmit can occur.
|
void |
onRttMeasurement(RttMeasurementFlyweight msg,
InetSocketAddress srcAddress)
Process a RTT (Round Trip Timing) message from a receiver.
|
void |
onStatusMessage(StatusMessageFlyweight msg,
InetSocketAddress srcAddress)
Process a status message to track connectivity and apply flow control.
|
void |
onTimeEvent(long timeNs,
long timeMs,
DriverConductor conductor)
Inform resource of timeNs passing and pass it DriverConductor to inform of any state transitions.
|
void |
removeSubscriber(SubscriptionLink subscriptionLink,
ReadablePosition position)
Remove a subscriber and its position used for tracking consumption.
|
void |
resend(int termId,
int termOffset,
int length)
Called when a retransmit should be sent.
|
int |
sessionId()
Session id allocated to this stream.
|
int |
streamId()
Stream id within the channel.
|
long |
timeOfLastStatusMessageNs()
Time of the last status message a from a receiver.
|
void |
triggerSendSetupFrame()
Trigger the sending of a SETUP frame so a connection can be established.
|
public boolean free()
DriverManagedResourcefree in interface DriverManagedResourcepublic void close()
DriverManagedResourceclose in interface DriverManagedResourceclose in interface AutoCloseablepublic long timeOfLastStatusMessageNs()
public String channel()
public int sessionId()
public int streamId()
public void triggerSendSetupFrame()
public void addSubscriber(SubscriptionLink subscriptionLink, ReadablePosition position)
SubscribableaddSubscriber in interface SubscribablesubscriptionLink - for identifying the subscriber.position - for tracking the subscriber.public void removeSubscriber(SubscriptionLink subscriptionLink, ReadablePosition position)
Subscribable
Note: The Subscribable is responsible for calling ReadablePosition.close() on
removed positions.
removeSubscriber in interface SubscribablesubscriptionLink - for identifying the subscriber.position - for tracking the subscriber.public void onNak(int termId,
int termOffset,
int length)
termId - in which the loss occurred.termOffset - at which the loss begins.length - of the loss.public void onStatusMessage(StatusMessageFlyweight msg, InetSocketAddress srcAddress)
msg - flyweight over the network packet.srcAddress - that the setup message has come from.public void onRttMeasurement(RttMeasurementFlyweight msg, InetSocketAddress srcAddress)
msg - flyweight over the network packet.srcAddress - that the RTT message has come from.public void resend(int termId,
int termOffset,
int length)
RetransmitSenderresend in interface RetransmitSendertermId - for the NAKtermOffset - for the NAKlength - for the NAKpublic void onTimeEvent(long timeNs,
long timeMs,
DriverConductor conductor)
DriverManagedResourceonTimeEvent in interface DriverManagedResourcetimeNs - now in nanoseconds.timeMs - now in milliseconds for epoch.conductor - to inform of any state transitions.public boolean hasReachedEndOfLife()
DriverManagedResourcehasReachedEndOfLife in interface DriverManagedResourceCopyright © 2014-2020 Real Logic Limited. All Rights Reserved.