Search in sources :

Example 31 with UdpChannel

use of io.aeron.driver.media.UdpChannel in project Aeron by real-logic.

the class UdpChannelTest method shouldHandleIpV6CanonicalFormForUnicastCorrectly.

@Theory
public void shouldHandleIpV6CanonicalFormForUnicastCorrectly(@Values({ "endpoint" }) final String endpointKey, @Values({ "interface" }) final String interfaceKey) throws Exception {
    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-00000000000000000000000000000001-0-c0a80001-40456"));
    assertThat(udpChannelLocalPort.canonicalForm(), is("UDP-7f000001-40455-fe8000000000000052465dfffe73df06-40456"));
}
Also used : UdpChannel(io.aeron.driver.media.UdpChannel) Theory(org.junit.experimental.theories.Theory)

Aggregations

UdpChannel (io.aeron.driver.media.UdpChannel)31 Test (org.junit.Test)16 Theory (org.junit.experimental.theories.Theory)11 ReceiveChannelEndpoint (io.aeron.driver.media.ReceiveChannelEndpoint)6 SendChannelEndpoint (io.aeron.driver.media.SendChannelEndpoint)4 RawLog (io.aeron.driver.buffer.RawLog)1 AeronUri (io.aeron.driver.uri.AeronUri)1 HashMap (java.util.HashMap)1