use of io.aeron.driver.media.SendChannelEndpoint in project Aeron by real-logic.
the class DriverConductor method onAddDestination.
void onAddDestination(final long registrationId, final String destinationChannel, final long correlationId) {
SendChannelEndpoint sendChannelEndpoint = null;
for (int i = 0, size = networkPublications.size(); i < size; i++) {
final NetworkPublication publication = networkPublications.get(i);
if (registrationId == publication.registrationId()) {
sendChannelEndpoint = publication.channelEndpoint();
break;
}
}
if (null == sendChannelEndpoint) {
throw new ControlProtocolException(UNKNOWN_PUBLICATION, "Unknown publication: " + registrationId);
}
sendChannelEndpoint.validateAllowsManualControl();
final AeronUri aeronUri = AeronUri.parse(destinationChannel);
final InetSocketAddress dstAddress = UdpChannel.destinationAddress(aeronUri);
senderProxy.addDestination(sendChannelEndpoint, dstAddress);
clientProxy.operationSucceeded(correlationId);
}
use of io.aeron.driver.media.SendChannelEndpoint in project Aeron by real-logic.
the class DriverConductor method onAddSpySubscription.
void onAddSpySubscription(final String channel, final int streamId, final long registrationId, final long clientId) {
final UdpChannel udpChannel = UdpChannel.parse(channel);
final AeronClient client = getOrAddClient(clientId);
final SpySubscriptionLink subscriptionLink = new SpySubscriptionLink(registrationId, udpChannel, streamId, client, context.clientLivenessTimeoutNs());
subscriptionLinks.add(subscriptionLink);
clientProxy.operationSucceeded(registrationId);
final SendChannelEndpoint channelEndpoint = sendChannelEndpointByChannelMap.get(udpChannel.canonicalForm());
for (int i = 0, size = networkPublications.size(); i < size; i++) {
final NetworkPublication publication = networkPublications.get(i);
if (streamId == publication.streamId() && channelEndpoint == publication.channelEndpoint() && NetworkPublication.Status.ACTIVE == publication.status()) {
linkSpy(publication, subscriptionLink);
}
}
}
Aggregations