use of io.aeron.driver.ReceiveChannelEndpointSupplier in project Aeron by real-logic.
the class JavaTestMediaDriver method enableLossGenerationOnReceive.
public static void enableLossGenerationOnReceive(final MediaDriver.Context context, final double rate, final long seed, final boolean loseDataMessages, final boolean loseControlMessages) {
final LossGenerator dataLossGenerator = loseDataMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
final LossGenerator controlLossGenerator = loseControlMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
final ReceiveChannelEndpointSupplier endpointSupplier = (udpChannel, dispatcher, statusIndicator, ctx) -> {
return new DebugReceiveChannelEndpoint(udpChannel, dispatcher, statusIndicator, ctx, dataLossGenerator, controlLossGenerator);
};
context.receiveChannelEndpointSupplier(endpointSupplier);
}
use of io.aeron.driver.ReceiveChannelEndpointSupplier in project aeron by real-logic.
the class JavaTestMediaDriver method enableLossGenerationOnReceive.
public static void enableLossGenerationOnReceive(final MediaDriver.Context context, final double rate, final long seed, final boolean loseDataMessages, final boolean loseControlMessages) {
final LossGenerator dataLossGenerator = loseDataMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
final LossGenerator controlLossGenerator = loseControlMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
final ReceiveChannelEndpointSupplier endpointSupplier = (udpChannel, dispatcher, statusIndicator, ctx) -> {
return new DebugReceiveChannelEndpoint(udpChannel, dispatcher, statusIndicator, ctx, dataLossGenerator, controlLossGenerator);
};
context.receiveChannelEndpointSupplier(endpointSupplier);
}
Aggregations