Package io.aeron.driver.ext
Class DebugReceiveChannelEndpoint
java.lang.Object
io.aeron.driver.media.UdpChannelTransport
io.aeron.driver.media.ReceiveChannelEndpoint
io.aeron.driver.ext.DebugReceiveChannelEndpoint
- All Implemented Interfaces:
AutoCloseable
Debug implementation which can introduce loss.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicCounterCounter for the number of errors frames send back by this channel endpoint.Fields inherited from class io.aeron.driver.media.UdpChannelTransport
connectAddress, context, errorHandler, receiveDatagramChannel, sendDatagramChannel, udpChannel -
Constructor Summary
ConstructorsConstructorDescriptionDebugReceiveChannelEndpoint(UdpChannel udpChannel, DataPacketDispatcher dispatcher, AtomicCounter statusIndicator, MediaDriver.Context context) Construct aReceiveChannelEndpointwith defaults for loss fromDebugChannelEndpointConfiguration.DebugReceiveChannelEndpoint(UdpChannel udpChannel, DataPacketDispatcher dispatcher, AtomicCounter statusIndicator, MediaDriver.Context context, LossGenerator dataLossGenerator, LossGenerator controlLossGenerator) Construct aReceiveChannelEndpointwith configuration for loss rate and seed. -
Method Summary
Modifier and TypeMethodDescriptionintonDataPacket(DataHeaderFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex) Callback to handle a received data packet.voidonRttMeasurement(RttMeasurementFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex) Callback to handle a received RTT Measurement frame.voidonSetupMessage(SetupFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex) Callback to handle a received setup frame.intsendTo(ByteBuffer buffer, InetSocketAddress remoteAddress) Send contents ofByteBufferto the remote address.Methods inherited from class io.aeron.driver.media.ReceiveChannelEndpoint
addDestination, close, decRefImages, decRefToStream, decRefToStreamAndSession, decResponseRefToStream, destination, destination, dispatcher, distinctSubscriptionCount, explicitControlAddress, hasDestination, hasDestinationControl, hasExplicitControl, hasTag, incRefImages, incRefToStream, incRefToStreamAndSession, incResponseRefToStream, indicateActive, indicateClosing, isMulticast, isMulticast, localSocketAddressIndicator, matchesTag, multicastTtl, multicastTtl, openChannel, originalUriString, possibleTtlAsymmetryEncountered, removeDestination, send, send, sendErrorFrame, sendNakMessage, sendResponseSetup, sendRttMeasurement, sendRttMeasurement, sendSetupElicitingStatusMessage, sendStatusMessage, shouldBeClosed, status, statusIndicatorCounter, subscriptionUdpChannel, tag, toString, udpChannel, udpChannel, updateControlAddress, validateAllowsDestinationControlMethods inherited from class io.aeron.driver.media.UdpChannelTransport
bindAddressAndPort, isValidFrame, onSendError, openDatagramChannel, receive, receiveDatagramChannel, receiveHook, resendHook, sendError, sendHook, socketRcvbufLength, socketSndbufLength, updateEndpoint
-
Field Details
-
errorFramesSent
Counter for the number of errors frames send back by this channel endpoint.
-
-
Constructor Details
-
DebugReceiveChannelEndpoint
public DebugReceiveChannelEndpoint(UdpChannel udpChannel, DataPacketDispatcher dispatcher, AtomicCounter statusIndicator, MediaDriver.Context context) Construct aReceiveChannelEndpointwith defaults for loss fromDebugChannelEndpointConfiguration.- Parameters:
udpChannel- for the media.dispatcher- for forwarding packets.statusIndicator- for the endpoint for the channel.context- for configuration.
-
DebugReceiveChannelEndpoint
public DebugReceiveChannelEndpoint(UdpChannel udpChannel, DataPacketDispatcher dispatcher, AtomicCounter statusIndicator, MediaDriver.Context context, LossGenerator dataLossGenerator, LossGenerator controlLossGenerator) Construct aReceiveChannelEndpointwith configuration for loss rate and seed.- Parameters:
udpChannel- for the media.dispatcher- for forwarding packets.statusIndicator- for the endpoint for the channel.context- for configuration.dataLossGenerator- for the random loss on the data stream.controlLossGenerator- for the random loss on the control stream.
-
-
Method Details
-
sendTo
Send contents ofByteBufferto the remote address.- Overrides:
sendToin classReceiveChannelEndpoint- Parameters:
buffer- to send containing the payload.remoteAddress- to send the payload to.- Returns:
- number of bytes sent.
-
onDataPacket
public int onDataPacket(DataHeaderFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex) Callback to handle a received data packet.- Overrides:
onDataPacketin classReceiveChannelEndpoint- Parameters:
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.- Returns:
- number of bytes applied as a result of this action.
-
onSetupMessage
public void onSetupMessage(SetupFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex) Callback to handle a received setup frame.- Overrides:
onSetupMessagein classReceiveChannelEndpoint- Parameters:
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.
-
onRttMeasurement
public void onRttMeasurement(RttMeasurementFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex) Callback to handle a received RTT Measurement frame.- Overrides:
onRttMeasurementin classReceiveChannelEndpoint- Parameters:
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.
-