Repository: netty/netty
File: transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java (Java)

Code before:
    }

    /**
     * Create a new instance using the given {@link SocketProtocolFamily}. If {@code null} is used it will depend
     * on the Operation Systems default which will be chosen.
     */
    public EpollDatagramChannel(SocketProtocolFamily family) {
        this(newSocketDgram(family), false);
    }

    /**
     * Create a new instance which selects the {@link SocketProtocolFamily} to use depending
     * on the Operation Systems default which will be chosen.
     */
    public EpollDatagramChannel(int fd) {
        this(new LinuxSocket(fd), true);
    }

    private EpollDatagramChannel(LinuxSocket fd, boolean active) {
        super(null, fd, active, EpollIoOps.valueOf(0));

        // Configure IP_MULTICAST_ALL - disable by default to match the behaviour of NIO.
        try {
            fd.setIpMulticastAll(IP_MULTICAST_ALL);
        } catch (IOException e) {
            logger.warn("Failed to set IP_MULTICAST_ALL to {}", IP_MULTICAST_ALL, e);
        }

        config = new EpollDatagramChannelConfig(this);
    }

    @Override
    public InetSocketAddress remoteAddress() {
        return (InetSocketAddress) super.remoteAddress();
    }

    @Override
    public InetSocketAddress localAddress() {
        return (InetSocketAddress) super.localAddress();
    }

    @Override
    public ChannelMetadata metadata() {
        return METADATA;
    }

    @Override
    public boolean isActive() {
        return socket.isOpen() && (config.getActiveOnOpen() && isRegistered() || active);
    }


Review comment (bug):
```suggestion
            logger.debug("Failed to set IP_MULTICAST_ALL to {}", IP_MULTICAST_ALL, e);
```

Code after:

    /**
     * Create a new instance using the given {@link SocketProtocolFamily}. If {@code null} is used it will depend
     * on the Operation Systems default which will be chosen.
     */
    public EpollDatagramChannel(SocketProtocolFamily family) {
        this(newSocketDgram(family), false);
    }

    /**
     * Create a new instance which selects the {@link SocketProtocolFamily} to use depending
     * on the Operation Systems default which will be chosen.
     */
    public EpollDatagramChannel(int fd) {
        this(new LinuxSocket(fd), true);
    }

    private EpollDatagramChannel(LinuxSocket fd, boolean active) {
        super(null, fd, active, EpollIoOps.valueOf(0));

        // Configure IP_MULTICAST_ALL - disable by default to match the behaviour of NIO.
        try {
            fd.setIpMulticastAll(IP_MULTICAST_ALL);
        } catch (IOException e) {
            logger.debug("Failed to set IP_MULTICAST_ALL to {}", IP_MULTICAST_ALL, e);
        }

        config = new EpollDatagramChannelConfig(this);
    }

    @Override
    public InetSocketAddress remoteAddress() {
        return (InetSocketAddress) super.remoteAddress();
    }

    @Override
    public InetSocketAddress localAddress() {
        return (InetSocketAddress) super.localAddress();
    }

    @Override
    public ChannelMetadata metadata() {
        return METADATA;
    }

    @Override
    public boolean isActive() {
        return socket.isOpen() && (config.getActiveOnOpen() && isRegistered() || active);
    }

    @Override