use of io.aeron.driver.media.ReceiveDestinationTransport in project Aeron by real-logic.
the class DriverConductor method onAddRcvNetworkDestination.
void onAddRcvNetworkDestination(final long registrationId, final String destinationChannel, final long correlationId) {
final UdpChannel udpChannel = UdpChannel.parse(destinationChannel, nameResolver, true);
validateDestinationUri(udpChannel.channelUri(), destinationChannel);
final SubscriptionLink mdsSubscriptionLink = findMdsSubscriptionLink(subscriptionLinks, registrationId);
if (null == mdsSubscriptionLink) {
throw new ControlProtocolException(UNKNOWN_SUBSCRIPTION, "unknown MDS subscription: " + registrationId);
}
final ReceiveChannelEndpoint receiveChannelEndpoint = mdsSubscriptionLink.channelEndpoint();
final AtomicCounter localSocketAddressIndicator = ReceiveLocalSocketAddress.allocate(tempBuffer, countersManager, registrationId, receiveChannelEndpoint.statusIndicatorCounter().id());
final ReceiveDestinationTransport transport = new ReceiveDestinationTransport(udpChannel, ctx, localSocketAddressIndicator, receiveChannelEndpoint);
receiverProxy.addDestination(receiveChannelEndpoint, transport);
clientProxy.operationSucceeded(correlationId);
}
use of io.aeron.driver.media.ReceiveDestinationTransport in project Aeron by real-logic.
the class Receiver method onRemoveDestination.
void onRemoveDestination(final ReceiveChannelEndpoint channelEndpoint, final UdpChannel udpChannel) {
final int transportIndex = channelEndpoint.destination(udpChannel);
if (ArrayUtil.UNKNOWN_INDEX != transportIndex) {
final ReceiveDestinationTransport transport = channelEndpoint.destination(transportIndex);
dataTransportPoller.cancelRead(channelEndpoint, transport);
channelEndpoint.removeDestination(transportIndex);
CloseHelper.close(transport);
dataTransportPoller.selectNowWithoutProcessing();
for (final PublicationImage image : publicationImages) {
if (channelEndpoint == image.channelEndpoint()) {
image.removeDestination(transportIndex);
}
}
}
}
use of io.aeron.driver.media.ReceiveDestinationTransport in project aeron by real-logic.
the class DriverConductor method onAddRcvNetworkDestination.
void onAddRcvNetworkDestination(final long registrationId, final String destinationChannel, final long correlationId) {
final UdpChannel udpChannel = UdpChannel.parse(destinationChannel, nameResolver, true);
validateDestinationUri(udpChannel.channelUri(), destinationChannel);
final SubscriptionLink mdsSubscriptionLink = findMdsSubscriptionLink(subscriptionLinks, registrationId);
if (null == mdsSubscriptionLink) {
throw new ControlProtocolException(UNKNOWN_SUBSCRIPTION, "unknown MDS subscription: " + registrationId);
}
final ReceiveChannelEndpoint receiveChannelEndpoint = mdsSubscriptionLink.channelEndpoint();
final AtomicCounter localSocketAddressIndicator = ReceiveLocalSocketAddress.allocate(tempBuffer, countersManager, registrationId, receiveChannelEndpoint.statusIndicatorCounter().id());
final ReceiveDestinationTransport transport = new ReceiveDestinationTransport(udpChannel, ctx, localSocketAddressIndicator, receiveChannelEndpoint);
receiverProxy.addDestination(receiveChannelEndpoint, transport);
clientProxy.operationSucceeded(correlationId);
}
use of io.aeron.driver.media.ReceiveDestinationTransport in project aeron by real-logic.
the class Receiver method onRemoveDestination.
void onRemoveDestination(final ReceiveChannelEndpoint channelEndpoint, final UdpChannel udpChannel) {
final int transportIndex = channelEndpoint.destination(udpChannel);
if (ArrayUtil.UNKNOWN_INDEX != transportIndex) {
final ReceiveDestinationTransport transport = channelEndpoint.destination(transportIndex);
dataTransportPoller.cancelRead(channelEndpoint, transport);
channelEndpoint.removeDestination(transportIndex);
CloseHelper.close(transport);
dataTransportPoller.selectNowWithoutProcessing();
for (final PublicationImage image : publicationImages) {
if (channelEndpoint == image.channelEndpoint()) {
image.removeDestination(transportIndex);
}
}
}
}
Aggregations