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 SpySubscriptionLink method matches.
boolean matches(final NetworkPublication publication) {
final UdpChannel publicationChannel = publication.channelEndpoint().udpChannel();
final boolean isSameChannelTag = udpChannel.hasTag() && udpChannel.tag() == publicationChannel.tag();
return streamId == publication.streamId() && (isSameChannelTag || (isWildcardOrSessionIdMatch(publication.sessionId()) && udpChannel.canonicalForm().equals(publicationChannel.canonicalForm())));
}
Aggregations