use of io.aeron.driver.media.UdpChannel in project aeron by real-logic.
the class UdpChannelTest method shouldHandleExplicitLocalAddressAndPortFormat.
@Test
public void shouldHandleExplicitLocalAddressAndPortFormat() {
final UdpChannel udpChannel = UdpChannel.parse("aeron:udp?interface=localhost:40123|endpoint=localhost:40124");
assertThat(udpChannel.localData(), is(new InetSocketAddress("localhost", 40123)));
assertThat(udpChannel.localControl(), is(new InetSocketAddress("localhost", 40123)));
assertThat(udpChannel.remoteData(), is(new InetSocketAddress("localhost", 40124)));
assertThat(udpChannel.remoteControl(), is(new InetSocketAddress("localhost", 40124)));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class StaticWindowCongestionControlTest method shouldSetWindowLengthFromChannel.
@Test
void shouldSetWindowLengthFromChannel() {
final UdpChannel channelWithWindow = UdpChannel.parse("aeron:udp?endpoint=127.0.0.1:9999|rcv-wnd=8192");
final MediaDriver.Context context = new MediaDriver.Context().initialWindowLength(16536);
final int termLength = 1_000_000;
final StaticWindowCongestionControl staticWindowCongestionControl = new StaticWindowCongestionControl(0, channelWithWindow, 0, 0, termLength, 0, null, null, null, context, null);
assertEquals(8192, staticWindowCongestionControl.initialWindowLength());
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldHandleIpV6CanonicalFormForUnicastCorrectly.
@ParameterizedTest
@CsvSource("endpoint,interface")
public void shouldHandleIpV6CanonicalFormForUnicastCorrectly(final String endpointKey, final String interfaceKey) {
assumeTrue(System.getProperty("java.net.preferIPv4Stack") == null);
final UdpChannel udpChannelLocal = UdpChannel.parse(uri(endpointKey, "192.168.0.1:40456", interfaceKey, "[::1]"));
final UdpChannel udpChannelLocalPort = UdpChannel.parse(uri(endpointKey, "[fe80::5246:5dff:fe73:df06]:40456", interfaceKey, "127.0.0.1:40455"));
assertThat(udpChannelLocal.canonicalForm(), is("UDP-" + udpChannelLocal.localData().getHostString() + ":0-192.168.0.1:40456"));
assertThat(udpChannelLocalPort.canonicalForm(), is("UDP-127.0.0.1:40455-[fe80::5246:5dff:fe73:df06]:40456"));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldGetProtocolFamilyForIpV6WithoutLocalSpecified.
@Test
public void shouldGetProtocolFamilyForIpV6WithoutLocalSpecified() {
assumeTrue(System.getProperty("java.net.preferIPv4Stack") == null);
final UdpChannel udpChannel = UdpChannel.parse("aeron:udp?endpoint=[::1]:12345");
assertThat(udpChannel.protocolFamily(), is(StandardProtocolFamily.INET6));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldHandleLocalhostLookupWithAeronUri.
@ParameterizedTest
@ValueSource(strings = "endpoint")
public void shouldHandleLocalhostLookupWithAeronUri(final String endpointKey) {
final UdpChannel udpChannel = UdpChannel.parse(uri(endpointKey, "localhost:40124"));
assertThat(udpChannel.remoteData(), is(new InetSocketAddress("127.0.0.1", 40124)));
assertThat(udpChannel.remoteControl(), is(new InetSocketAddress("127.0.0.1", 40124)));
}
Aggregations