Search in sources :

Example 16 with ChannelUri

use of io.aeron.ChannelUri in project aeron by real-logic.

the class DriverConductor method onRemoveSendDestination.

void onRemoveSendDestination(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 ChannelUri channelUri = ChannelUri.parse(destinationChannel);
    final InetSocketAddress dstAddress = UdpChannel.destinationAddress(channelUri, nameResolver);
    senderProxy.removeDestination(sendChannelEndpoint, channelUri, dstAddress);
    clientProxy.operationSucceeded(correlationId);
}
Also used : ChannelUri(io.aeron.ChannelUri) SendChannelEndpoint(io.aeron.driver.media.SendChannelEndpoint) InetSocketAddress(java.net.InetSocketAddress) ControlProtocolException(io.aeron.exceptions.ControlProtocolException) ReceiveChannelEndpoint(io.aeron.driver.media.ReceiveChannelEndpoint) SendChannelEndpoint(io.aeron.driver.media.SendChannelEndpoint)

Aggregations

ChannelUri (io.aeron.ChannelUri)16 SendChannelEndpoint (io.aeron.driver.media.SendChannelEndpoint)8 ReceiveChannelEndpoint (io.aeron.driver.media.ReceiveChannelEndpoint)6 InetSocketAddress (java.net.InetSocketAddress)6 PublicationParams (io.aeron.driver.PublicationParams)5 ControlProtocolException (io.aeron.exceptions.ControlProtocolException)4 CommonContext (io.aeron.CommonContext)3 InvalidChannelException (io.aeron.driver.exceptions.InvalidChannelException)3 Publication (io.aeron.Publication)2 ClusteredService (io.aeron.cluster.service.ClusteredService)2 ControlProtocolException (io.aeron.driver.exceptions.ControlProtocolException)2 UdpChannel (io.aeron.driver.media.UdpChannel)2 Test (org.junit.Test)2