Search in sources :

Example 1 with AeronEvent

use of io.aeron.exceptions.AeronEvent in project Aeron by real-logic.

the class DriverConductor method onReResolveControl.

void onReResolveControl(final String control, final UdpChannel udpChannel, final ReceiveChannelEndpoint channelEndpoint, final InetSocketAddress address) {
    try {
        final InetSocketAddress newAddress = UdpChannel.resolve(control, CommonContext.MDC_CONTROL_PARAM_NAME, true, nameResolver);
        if (newAddress.isUnresolved()) {
            ctx.errorHandler().onError(new AeronEvent("could not re-resolve: control=" + control));
            errorCounter.increment();
        } else if (!address.equals(newAddress)) {
            receiverProxy.onResolutionChange(channelEndpoint, udpChannel, newAddress);
        }
    } catch (final Exception ex) {
        ctx.errorHandler().onError(ex);
        errorCounter.increment();
    }
}
Also used : InetSocketAddress(java.net.InetSocketAddress) AeronEvent(io.aeron.exceptions.AeronEvent) InvalidChannelException(io.aeron.driver.exceptions.InvalidChannelException) ControlProtocolException(io.aeron.exceptions.ControlProtocolException)

Example 2 with AeronEvent

use of io.aeron.exceptions.AeronEvent in project Aeron by real-logic.

the class DriverConductor method onReResolveEndpoint.

void onReResolveEndpoint(final String endpoint, final SendChannelEndpoint channelEndpoint, final InetSocketAddress address) {
    try {
        final InetSocketAddress newAddress = UdpChannel.resolve(endpoint, CommonContext.ENDPOINT_PARAM_NAME, true, nameResolver);
        if (newAddress.isUnresolved()) {
            ctx.errorHandler().onError(new AeronEvent("could not re-resolve: endpoint=" + endpoint));
            errorCounter.increment();
        } else if (!address.equals(newAddress)) {
            senderProxy.onResolutionChange(channelEndpoint, endpoint, newAddress);
        }
    } catch (final Exception ex) {
        ctx.errorHandler().onError(ex);
        errorCounter.increment();
    }
}
Also used : InetSocketAddress(java.net.InetSocketAddress) AeronEvent(io.aeron.exceptions.AeronEvent) InvalidChannelException(io.aeron.driver.exceptions.InvalidChannelException) ControlProtocolException(io.aeron.exceptions.ControlProtocolException)

Aggregations

InvalidChannelException (io.aeron.driver.exceptions.InvalidChannelException)2 AeronEvent (io.aeron.exceptions.AeronEvent)2 ControlProtocolException (io.aeron.exceptions.ControlProtocolException)2 InetSocketAddress (java.net.InetSocketAddress)2