public class ReceiveChannelEndpoint extends UdpChannelTransport
connectAddress, context, errorHandler, isClosed, receiveDatagramChannel, selectionKey, sendDatagramChannel, udpChannel| Constructor and Description |
|---|
ReceiveChannelEndpoint(UdpChannel udpChannel,
DataPacketDispatcher dispatcher,
AtomicCounter statusIndicator,
MediaDriver.Context context)
Construct the receiver end for data streams.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addDestination(ReceiveDestinationTransport transport)
Add a destination to the channel to receive on.
|
void |
closeIndicators()
Close the counters used to indicate channel status.
|
void |
closeMultiRcvDestinationIndicators(DriverConductorProxy conductorProxy)
Close the
MultiRcvDestination indicators. |
void |
closeMultiRcvDestinationTransports(DataTransportPoller poller)
Close transports for
MultiRcvDestination if present. |
void |
decRefImages()
Called from the
DriverConductor to
decrement image ref count for this channel endpoint. |
int |
decRefToStream(int streamId)
Called from the
DriverConductor to
decrement the reference count for a given stream id. |
long |
decRefToStreamAndSession(int streamId,
int sessionId)
Called from the
DriverConductor to
decrement the reference count for a given stream id and session id. |
ReceiveDestinationTransport |
destination(int transportIndex)
Get the transport destination for a given index.
|
int |
destination(UdpChannel udpChannel)
Get the transport index for a given channel.
|
DataPacketDispatcher |
dispatcher()
Dispatcher for the channel.
|
int |
distinctSubscriptionCount()
Total count of distinct subscriptions to streams.
|
InetSocketAddress |
explicitControlAddress()
Does the channel have an explicit control address as used with multi-destination-cast or not?
|
boolean |
hasDestination(int transportIndex)
Does the channel have a destination for a given index value.
|
boolean |
hasDestinationControl()
Has the channel got control of destinations for MDS.
|
boolean |
hasExplicitControl()
Does the channel have an explicit control address as used with multi-destination-cast or not?
|
boolean |
hasTag()
Has the channel been tagged?
|
void |
incRefImages()
Called from the
DriverConductor to
increment image ref count for this channel endpoint. |
int |
incRefToStream(int streamId)
Called from the
DriverConductor to
increment the reference count for a given stream id. |
long |
incRefToStreamAndSession(int streamId,
int sessionId)
Called from the
DriverConductor to
increment the reference count for a given stream id and session id. |
void |
indicateActive()
Indicate that the channel as active after successfully opening it.
|
boolean |
isMulticast()
Is the primary transport multicast?
|
boolean |
isMulticast(int transportIndex)
Is a given transport index multicast?
|
void |
localSocketAddressIndicator(AtomicCounter counter)
Set a channel binding status counter, if required (not used by control-mode=manual).
|
boolean |
matchesTag(UdpChannel udpChannel)
Does the channel have a matching tag?
|
int |
multicastTtl()
Get the multicast TTL for the primary transport.
|
int |
multicastTtl(int transportIndex)
Get the multicast TTL for the transport index.
|
int |
onDataPacket(DataHeaderFlyweight header,
UnsafeBuffer buffer,
int length,
InetSocketAddress srcAddress,
int transportIndex)
Callback to handle a received data packet.
|
void |
onRttMeasurement(RttMeasurementFlyweight header,
UnsafeBuffer buffer,
int length,
InetSocketAddress srcAddress,
int transportIndex)
Callback to handle a received RTT Measurement frame.
|
void |
onSetupMessage(SetupFlyweight header,
UnsafeBuffer buffer,
int length,
InetSocketAddress srcAddress,
int transportIndex)
Callback to handle a received setup frame.
|
void |
openChannel(DriverConductorProxy conductorProxy)
Open the underlying sockets for the channel.
|
String |
originalUriString()
The original URI String used when a subscription was added.
|
void |
possibleTtlAsymmetryEncountered()
Increment the
SystemCounterDescriptor.POSSIBLE_TTL_ASYMMETRY counter. |
void |
removeDestination(int transportIndex)
Remove transport by index from the channel.
|
protected void |
send(ByteBuffer buffer,
int length,
ImageConnection[] imageConnections)
Send a frame to the image connections.
|
protected void |
send(ByteBuffer buffer,
int length,
int transportIndex,
InetSocketAddress remoteAddress)
Send a frame to a source.
|
void |
sendNakMessage(ImageConnection[] controlAddresses,
int sessionId,
int streamId,
int termId,
int termOffset,
int length)
Send a NAK message back to the sources.
|
void |
sendRttMeasurement(ImageConnection[] controlAddresses,
int sessionId,
int streamId,
long echoTimestampNs,
long receptionDelta,
boolean isReply)
Send RTT Measurement frame to the sources.
|
void |
sendRttMeasurement(int transportIndex,
InetSocketAddress controlAddress,
int sessionId,
int streamId,
long echoTimestampNs,
long receptionDelta,
boolean isReply)
Send RTT Measurement frame to a source.
|
void |
sendSetupElicitingStatusMessage(int transportIndex,
InetSocketAddress controlAddress,
int sessionId,
int streamId)
Send a Setup Eliciting Status Message to a source.
|
void |
sendStatusMessage(ImageConnection[] controlAddresses,
int sessionId,
int streamId,
int termId,
int termOffset,
int windowLength,
short flags)
Send a Status Message back to a sources.
|
int |
sendTo(ByteBuffer buffer,
InetSocketAddress remoteAddress)
Send contents of
ByteBuffer to the remote address. |
boolean |
shouldBeClosed()
Called from the
DriverConductor to
determine if the channel should be closed for cleanup. |
AtomicCounter |
statusIndicatorCounter()
Counter which indicates the status of the channel.
|
UdpChannel |
subscriptionUdpChannel()
Return the
UdpChannel for the Subscription channel. |
long |
tag()
The tag identity for the channel.
|
UdpChannel |
udpChannel()
Get the
UdpChannel for the primary transport. |
UdpChannel |
udpChannel(int transportIndex)
Get the
UdpChannel for the transport index. |
void |
updateControlAddress(int transportIndex,
InetSocketAddress newAddress)
Update the control address for a channel transport when re-resolution occurs.
|
void |
validateAllowsDestinationControl()
Validate that the channel allows destination control.
|
bindAddressAndPort, close, isClosed, isValidFrame, openDatagramChannel, receive, receiveDatagramChannel, receiveHook, registerForRead, sendError, sendHook, socketRcvbufLength, socketSndbufLength, updateEndpointpublic ReceiveChannelEndpoint(UdpChannel udpChannel, DataPacketDispatcher dispatcher, AtomicCounter statusIndicator, MediaDriver.Context context)
udpChannel - configuration for the media.dispatcher - for forwarding packets.statusIndicator - to indicate the status of the channel endpoint.context - for configuration.public void localSocketAddressIndicator(AtomicCounter counter)
counter - to be set.public int sendTo(ByteBuffer buffer, InetSocketAddress remoteAddress)
ByteBuffer to the remote address.buffer - to send containing the payload.remoteAddress - to send the payload to.public String originalUriString()
public AtomicCounter statusIndicatorCounter()
public void indicateActive()
public void closeIndicators()
public void closeMultiRcvDestinationTransports(DataTransportPoller poller)
MultiRcvDestination if present.poller - associated with the MultiRcvDestination if present to be used for selecting without
processing.public void closeMultiRcvDestinationIndicators(DriverConductorProxy conductorProxy)
MultiRcvDestination indicators.conductorProxy - for sending back counters to be closed.public void openChannel(DriverConductorProxy conductorProxy)
conductorProxy - for notifying potential channel errors.public void possibleTtlAsymmetryEncountered()
SystemCounterDescriptor.POSSIBLE_TTL_ASYMMETRY counter.public int incRefToStream(int streamId)
DriverConductor to
increment the reference count for a given stream id.streamId - to increment the reference for.public int decRefToStream(int streamId)
DriverConductor to
decrement the reference count for a given stream id.streamId - to decrement the reference for.public long incRefToStreamAndSession(int streamId,
int sessionId)
DriverConductor to
increment the reference count for a given stream id and session id.streamId - to increment the reference for.sessionId - to increment the reference for.public long decRefToStreamAndSession(int streamId,
int sessionId)
DriverConductor to
decrement the reference count for a given stream id and session id.streamId - to increment the reference for.sessionId - to increment the reference for.public int distinctSubscriptionCount()
public boolean shouldBeClosed()
DriverConductor to
determine if the channel should be closed for cleanup.public boolean hasExplicitControl()
public InetSocketAddress explicitControlAddress()
public boolean hasDestinationControl()
public void validateAllowsDestinationControl()
If not then a ControlProtocolException will be thrown.
public boolean isMulticast()
isMulticast in class UdpChannelTransportpublic boolean isMulticast(int transportIndex)
transportIndex - to check for multicast.public UdpChannel subscriptionUdpChannel()
UdpChannel for the Subscription channel.UdpChannel for the Subscription channel.public UdpChannel udpChannel()
UdpChannel for the primary transport.udpChannel in class UdpChannelTransportUdpChannel for the primary transport.public UdpChannel udpChannel(int transportIndex)
UdpChannel for the transport index.transportIndex - to the UdpChannel.UdpChannel for the transport index.public boolean hasTag()
public long tag()
public boolean matchesTag(UdpChannel udpChannel)
udpChannel - with tag to match against.public int multicastTtl()
multicastTtl in class UdpChannelTransportpublic int multicastTtl(int transportIndex)
transportIndex - to get the multicast TTL for.public int addDestination(ReceiveDestinationTransport transport)
transport - to add for the destination.public void removeDestination(int transportIndex)
transportIndex - to be removed.public int destination(UdpChannel udpChannel)
udpChannel - to look up the transport index for.ArrayUtil.UNKNOWN_INDEX.public ReceiveDestinationTransport destination(int transportIndex)
transportIndex - to get.public boolean hasDestination(int transportIndex)
transportIndex - to check if a destination exists for.public int onDataPacket(DataHeaderFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex)
header - of the data first frame.buffer - containing the data packet.length - of the data packet.srcAddress - from which the data packet was received.transportIndex - on which the packet was received.public void onSetupMessage(SetupFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex)
header - of the setup frame.buffer - containing the setup frame.length - of the setup frame.srcAddress - the message came from.transportIndex - on which the message was received.public void onRttMeasurement(RttMeasurementFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex)
header - of the RTT Measurement frame.buffer - containing the RTT Measurement frame.length - of the RTT Measurement frame.srcAddress - the message came from.transportIndex - on which the message was received.public void sendSetupElicitingStatusMessage(int transportIndex,
InetSocketAddress controlAddress,
int sessionId,
int streamId)
transportIndex - for the source.controlAddress - for the source.sessionId - for the image.streamId - for the image.public void sendRttMeasurement(int transportIndex,
InetSocketAddress controlAddress,
int sessionId,
int streamId,
long echoTimestampNs,
long receptionDelta,
boolean isReply)
transportIndex - for the source.controlAddress - for the source.sessionId - for the image.streamId - for the image.echoTimestampNs - timestamp to echo in a reply.receptionDelta - time in nanoseconds between receiving original request and sending Reply RTT Measurement.isReply - true if a reply.public void sendStatusMessage(ImageConnection[] controlAddresses, int sessionId, int streamId, int termId, int termOffset, int windowLength, short flags)
controlAddresses - of the sources.sessionId - of the image.streamId - of the image.termId - of the image to indicate position.termOffset - of the image to indicate position.windowLength - for available buffer from the position.flags - for the header.public void sendNakMessage(ImageConnection[] controlAddresses, int sessionId, int streamId, int termId, int termOffset, int length)
controlAddresses - of the sources.sessionId - of the image.streamId - of the image.termId - of the image to indicate position.termOffset - of the image to indicate position.length - of the range to be re-transmitted.public void sendRttMeasurement(ImageConnection[] controlAddresses, int sessionId, int streamId, long echoTimestampNs, long receptionDelta, boolean isReply)
controlAddresses - of the sources.sessionId - for the image.streamId - for the image.echoTimestampNs - timestamp to echo in a reply.receptionDelta - time in nanoseconds between receiving original request and sending Reply RTT Measurement.isReply - true if a reply.public DataPacketDispatcher dispatcher()
public void updateControlAddress(int transportIndex,
InetSocketAddress newAddress)
transportIndex - to update the control address for.newAddress - for the control of the transport.protected void send(ByteBuffer buffer, int length, ImageConnection[] imageConnections)
buffer - containing the frame.length - of the frame in the buffer.imageConnections - to send the frame to.protected void send(ByteBuffer buffer, int length, int transportIndex, InetSocketAddress remoteAddress)
buffer - containing the frame.length - of the frame in the buffer.transportIndex - to send the frame on.remoteAddress - to send the frame to.public void incRefImages()
DriverConductor to
increment image ref count for this channel endpoint.public void decRefImages()
DriverConductor to
decrement image ref count for this channel endpoint.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.