use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldParseChannelSendAndReceiveTimestampOffsets.
@Test
void shouldParseChannelSendAndReceiveTimestampOffsets() {
final UdpChannel channel = UdpChannel.parse("aeron:udp?endpoint=localhost:0|channel-rcv-ts-offset=reserved|channel-snd-ts-offset=8");
assertEquals(UdpChannel.RESERVED_VALUE_MESSAGE_OFFSET, channel.channelReceiveTimestampOffset());
assertEquals(8, channel.channelSendTimestampOffset());
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldHandleExplicitLocalControlAddressAndPortFormatIPv4.
@Test
public void shouldHandleExplicitLocalControlAddressAndPortFormatIPv4() {
final UdpChannel udpChannel = UdpChannel.parse("aeron:udp?control=localhost:40124|control-mode=dynamic");
assertThat(udpChannel.localData(), is(new InetSocketAddress("localhost", 40124)));
assertThat(udpChannel.localControl(), is(new InetSocketAddress("localhost", 40124)));
assertThat(udpChannel.remoteData(), is(new InetSocketAddress("0.0.0.0", 0)));
assertThat(udpChannel.remoteControl(), is(new InetSocketAddress("0.0.0.0", 0)));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class MinMulticastFlowControlTest method shouldNotBeConnectedUntilGroupMinSizeReached.
@Test
void shouldNotBeConnectedUntilGroupMinSizeReached() {
final UdpChannel udpChannel = UdpChannel.parse("aeron:udp?endpoint=224.20.30.39:24326|interface=localhost|fc=min,g:/3");
flowControl.initialize(new MediaDriver.Context(), udpChannel, 0, 0);
onStatusMessage(flowControl, 1, 0, 5000);
assertFalse(flowControl.hasRequiredReceivers());
onStatusMessage(flowControl, 2, 0, 5000);
assertFalse(flowControl.hasRequiredReceivers());
onStatusMessage(flowControl, 2, 0, 5000);
assertFalse(flowControl.hasRequiredReceivers());
onStatusMessage(flowControl, 3, 0, 5000);
assertTrue(flowControl.hasRequiredReceivers());
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class MinMulticastFlowControlTest method shouldReportSenderLimitUntilGroupMinSizeIsReached.
@Test
void shouldReportSenderLimitUntilGroupMinSizeIsReached() {
final UdpChannel udpChannel = UdpChannel.parse("aeron:udp?endpoint=224.20.30.39:24326|interface=localhost|fc=min,g:/3");
flowControl.initialize(new MediaDriver.Context(), udpChannel, 0, 0);
final int senderLimit = 5000;
final int termOffset = 6000;
assertEquals(senderLimit, onStatusMessage(flowControl, 1, termOffset, senderLimit));
assertEquals(senderLimit, onIdle(flowControl, senderLimit));
assertEquals(senderLimit, onStatusMessage(flowControl, 2, termOffset, senderLimit));
assertEquals(senderLimit, onIdle(flowControl, senderLimit));
assertEquals(senderLimit, onStatusMessage(flowControl, 2, termOffset, senderLimit));
assertEquals(senderLimit, onIdle(flowControl, senderLimit));
assertEquals(termOffset + WINDOW_LENGTH, onStatusMessage(flowControl, 3, termOffset, senderLimit));
assertEquals(termOffset + WINDOW_LENGTH, onIdle(flowControl, senderLimit));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class StaticWindowCongestionControlTest method shouldSetWindowLengthFromContext.
@Test
void shouldSetWindowLengthFromContext() {
final UdpChannel channelWithoutWindow = UdpChannel.parse("aeron:udp?endpoint=127.0.0.1:9999");
final MediaDriver.Context context = new MediaDriver.Context().initialWindowLength(16536);
final int termLength = 1_000_000;
final StaticWindowCongestionControl staticWindowCongestionControl = new StaticWindowCongestionControl(0, channelWithoutWindow, 0, 0, termLength, 0, null, null, null, context, null);
assertEquals(16536, staticWindowCongestionControl.initialWindowLength());
}
Aggregations