use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldGetProtocolFamilyForIpV6.
@Test
public void shouldGetProtocolFamilyForIpV6() {
assumeTrue(System.getProperty("java.net.preferIPv4Stack") == null);
final UdpChannel udpChannel = UdpChannel.parse("aeron:udp?endpoint=[::1]:12345|interface=[::1]");
assertThat(udpChannel.protocolFamily(), is(StandardProtocolFamily.INET6));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldHandleCanonicalFormWithNsLookup.
@Test
public void shouldHandleCanonicalFormWithNsLookup() {
final UdpChannel udpChannelExampleCom = UdpChannel.parse("aeron:udp?endpoint=localhost:40456");
assertThat(udpChannelExampleCom.canonicalForm(), is("UDP-0.0.0.0:0-localhost:40456"));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldParseReceiverWindow.
@Test
void shouldParseReceiverWindow() {
final UdpChannel udpChannelWithBufferSizes = UdpChannel.parse("aeron:udp?endpoint=127.0.0.1:9999|rcv-wnd=8192");
assertEquals(8192, udpChannelWithBufferSizes.receiverWindowLength());
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldHandleCanonicalFormForMulticastWithLocalPort.
@Test
public void shouldHandleCanonicalFormForMulticastWithLocalPort() {
final UdpChannel udpChannelLocalPort = UdpChannel.parse("aeron:udp?interface=127.0.0.1:40455|endpoint=224.0.1.1:40456");
assertThat(udpChannelLocalPort.canonicalForm(), is("UDP-127.0.0.1:40455-224.0.1.1:40456"));
final UdpChannel udpChannelSubnetLocalPort = UdpChannel.parse("aeron:udp?interface=127.0.0.0:40455/29|endpoint=224.0.1.1:40456");
assertThat(udpChannelSubnetLocalPort.canonicalForm(), matchesPattern("UDP-127\\.0\\.0\\.[1-7]:40455-224\\.0\\.1\\.1:40456"));
}
use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.
the class UdpChannelTest method shouldHandleIpV6CanonicalFormForMulticastCorrectly.
@ParameterizedTest
@CsvSource("endpoint,interface")
public void shouldHandleIpV6CanonicalFormForMulticastCorrectly(final String endpointKey, final String interfaceKey) {
assumeTrue(System.getProperty("java.net.preferIPv4Stack") == null);
final UdpChannel udpChannel = UdpChannel.parse(uri(endpointKey, "[FF01::FD]:40456", interfaceKey, "localhost"));
final UdpChannel udpChannelLocal = UdpChannel.parse(uri(endpointKey, "224.0.1.1:40456", interfaceKey, "[::1]:54321/64"));
assertThat(udpChannel.canonicalForm(), is("UDP-127.0.0.1:0-" + udpChannel.remoteData().getHostString() + ":40456"));
assertThat(udpChannelLocal.canonicalForm(), is("UDP-" + udpChannelLocal.localData().getHostString() + ":54321-224.0.1.1:40456"));
}
Aggregations