public final class NetworkPublication extends Object implements RetransmitSender, DriverManagedResource, Subscribable
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscriber(SubscriptionLink subscriptionLink,
ReadablePosition position,
long nowNs)
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 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 frame should be sent to request the retransmission of data.
|
int |
sessionId()
Session id allocated to this stream.
|
int |
streamId()
Stream id within the channel.
|
long |
subscribableRegistrationId()
Registration ID that is in use by the subscribable.
|
long |
timeOfLastStatusMessageNs()
Time of the last status message a from a receiver.
|
void |
triggerSendSetupFrame(StatusMessageFlyweight msg,
InetSocketAddress srcAddress)
Trigger the sending of a SETUP frame so a connection can be established.
|
public boolean free()
free in interface DriverManagedResourcepublic void close()
DriverManagedResource.free(). That will
need to be called separately at the appropriate time.close in interface DriverManagedResourcepublic long timeOfLastStatusMessageNs()
public String channel()
public int sessionId()
public int streamId()
public void triggerSendSetupFrame(StatusMessageFlyweight msg, InetSocketAddress srcAddress)
msg - that triggers the SETUP.srcAddress - of the source that triggers the SETUP.public long subscribableRegistrationId()
subscribableRegistrationId in interface Subscribablepublic void addSubscriber(SubscriptionLink subscriptionLink, ReadablePosition position, long nowNs)
addSubscriber in interface SubscribablesubscriptionLink - for identifying the subscriber.position - for tracking the subscriber.nowNs - for the current time.public void removeSubscriber(SubscriptionLink subscriptionLink, ReadablePosition position)
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)
resend in interface RetransmitSendertermId - containing the data to NAK.termOffset - of the data to NAK.length - of the data to NAK.public void onTimeEvent(long timeNs,
long timeMs,
DriverConductor conductor)
onTimeEvent in interface DriverManagedResourcetimeNs - now in nanoseconds.timeMs - now in milliseconds for epoch.conductor - to inform of any state transitions.public boolean hasReachedEndOfLife()
hasReachedEndOfLife in interface DriverManagedResourceCopyright © 2014-2023 Real Logic Limited. All Rights Reserved.