public class SendChannelEndpoint extends UdpChannelTransport
NetworkPublications onto a single transport channel for the
sending of data and setup frames plus the receiving of status and NAK frames.connectAddress, context, errorHandler, isClosed, receiveDatagramChannel, selectionKey, sendDatagramChannel, udpChannel| Constructor and Description |
|---|
SendChannelEndpoint(UdpChannel udpChannel,
AtomicCounter statusIndicator,
MediaDriver.Context context)
Construct the sender end for data streams.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDestination(ChannelUri channelUri,
InetSocketAddress address)
Add a destination for an MDC channel.
|
void |
allocateDestinationsCounterForMdc(MutableDirectBuffer tempBuffer,
CountersManager countersManager,
long registrationId,
String originalUriString)
Allocate a destinations counter if the channel uses multiple destinations.
|
void |
checkForReResolution(long nowNs,
DriverConductorProxy conductorProxy)
Check sockets may need to be re-resolved due to no activity.
|
void |
closeIndicators()
Close the counters used to indicate channel status.
|
void |
decRef()
Decrement the reference count to the channel.
|
void |
incRef()
Increment the reference count to the channel.
|
void |
indicateActive()
Indicate that the channel as active after successfully opening it.
|
void |
localSocketAddressIndicator(AtomicCounter counter)
Set a channel binding status counter.
|
void |
onNakMessage(NakFlyweight msg,
UnsafeBuffer buffer,
int length,
InetSocketAddress srcAddress)
Callback back handler for received NAK messages.
|
void |
onRttMeasurement(RttMeasurementFlyweight msg,
UnsafeBuffer buffer,
int length,
InetSocketAddress srcAddress)
Callback back handler for received RTT Measurement messages.
|
void |
onStatusMessage(StatusMessageFlyweight msg,
UnsafeBuffer buffer,
int length,
InetSocketAddress srcAddress)
Callback back handler for received status messages.
|
void |
openChannel(DriverConductorProxy conductorProxy)
Open the underlying sockets for the channel.
|
String |
originalUriString()
The original URI String used when a subscription was added.
|
void |
registerForSend(NetworkPublication publication)
Called from the
Sender to add information to the control packet dispatcher. |
void |
removeDestination(ChannelUri channelUri,
InetSocketAddress address)
Remove a destination from an MDC channel.
|
void |
resolutionChange(String endpoint,
InetSocketAddress newAddress)
Update the endpoint for the channel on address change.
|
int |
send(ByteBuffer buffer)
Send contents of a
ByteBuffer to connected address. |
boolean |
shouldBeClosed()
Called by to determine if the channel endpoint should be closed.
|
int |
statusIndicatorCounterId()
Counter id of the channel status indicator counter.
|
void |
unregisterForSend(NetworkPublication publication)
Called from the
Sender to remove information from the control packet dispatcher. |
void |
validateAllowsManualControl()
Validate that the channel allows manual control for destinations.
|
bindAddressAndPort, close, isClosed, isMulticast, isValidFrame, multicastTtl, openDatagramChannel, receive, receiveDatagramChannel, receiveHook, registerForRead, sendError, sendHook, socketRcvbufLength, socketSndbufLength, udpChannel, updateEndpointpublic SendChannelEndpoint(UdpChannel udpChannel, AtomicCounter statusIndicator, MediaDriver.Context context)
udpChannel - configuration for the media.statusIndicator - to indicate the status of the channel endpoint.context - for configuration.public void localSocketAddressIndicator(AtomicCounter counter)
counter - to be set.public void decRef()
public void incRef()
public void openChannel(DriverConductorProxy conductorProxy)
conductorProxy - for notifying potential channel errors.public String originalUriString()
public int statusIndicatorCounterId()
public void indicateActive()
public void closeIndicators()
public boolean shouldBeClosed()
public void registerForSend(NetworkPublication publication)
Sender to add information to the control packet dispatcher.publication - to add to the dispatcherpublic void unregisterForSend(NetworkPublication publication)
Sender to remove information from the control packet dispatcher.publication - to removepublic int send(ByteBuffer buffer)
ByteBuffer to connected address.
This is used on the sender side for performance over send(ByteBuffer, SocketAddress).buffer - to sendpublic void checkForReResolution(long nowNs,
DriverConductorProxy conductorProxy)
nowNs - to test against for activity.conductorProxy - to notify of any addresses which may need to be re-resolved.public void onStatusMessage(StatusMessageFlyweight msg, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress)
msg - flyweight over the status message.buffer - containing the message.length - of the message.srcAddress - of the message.public void onNakMessage(NakFlyweight msg, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress)
msg - flyweight over the NAK message.buffer - containing the message.length - of the message.srcAddress - of the message.public void onRttMeasurement(RttMeasurementFlyweight msg, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress)
msg - flyweight over the RTT message.buffer - containing the message.length - of the message.srcAddress - of the message.public void validateAllowsManualControl()
If not then a ControlProtocolException will be thrown.
public void addDestination(ChannelUri channelUri, InetSocketAddress address)
channelUri - for the destination to be added.address - of the destination to be added.public void removeDestination(ChannelUri channelUri, InetSocketAddress address)
channelUri - for the destination to be removed.address - of the destination to be removed.public void resolutionChange(String endpoint, InetSocketAddress newAddress)
endpoint - associated with the address.newAddress - for the endpoint.public void allocateDestinationsCounterForMdc(MutableDirectBuffer tempBuffer, CountersManager countersManager, long registrationId, String originalUriString)
tempBuffer - to use for metadata formatting.countersManager - for the driver.registrationId - of the endpoint.originalUriString - of the channel.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.