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 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()
free
in interface DriverManagedResource
public void close()
close
in interface DriverManagedResource
close
in interface AutoCloseable
public long timeOfLastStatusMessageNs()
public String channel()
public int sessionId()
public int streamId()
public void triggerSendSetupFrame()
public void addSubscriber(SubscriptionLink subscriptionLink, ReadablePosition position, long nowNs)
addSubscriber
in interface Subscribable
subscriptionLink
- 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 Subscribable
subscriptionLink
- 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 RetransmitSender
termId
- for the NAKtermOffset
- for the NAKlength
- for the NAKpublic void onTimeEvent(long timeNs, long timeMs, DriverConductor conductor)
onTimeEvent
in interface DriverManagedResource
timeNs
- now in nanoseconds.timeMs
- now in milliseconds for epoch.conductor
- to inform of any state transitions.public boolean hasReachedEndOfLife()
hasReachedEndOfLife
in interface DriverManagedResource
Copyright © 2014-2021 Real Logic Limited. All Rights Reserved.