Class NioDatagramChannel

    • Method Detail

      • openNonBlockingChannel

        private static java.nio.channels.DatagramChannel openNonBlockingChannel​(InternetProtocolFamily family)
      • isBound

        public boolean isBound()
        Description copied from interface: Channel
        Returns true if and only if this channel is bound to a local address.
        Specified by:
        isBound in interface Channel
      • isConnected

        public boolean isConnected()
        Description copied from interface: Channel
        Returns true if and only if this channel is connected to a remote address.
        Specified by:
        isConnected in interface Channel
      • setClosed

        protected boolean setClosed()
        Description copied from class: AbstractChannel
        Marks this channel as closed. This method is intended to be called by an internal component - please do not call it unless you know what you are doing.
        Overrides:
        setClosed in class AbstractNioChannel<java.nio.channels.DatagramChannel>
        Returns:
        true if and only if this channel was not marked as closed yet
      • getDatagramChannel

        java.nio.channels.DatagramChannel getDatagramChannel()
      • joinGroup

        public ChannelFuture joinGroup​(java.net.InetSocketAddress multicastAddress,
                                       java.net.NetworkInterface networkInterface)
        Description copied from interface: DatagramChannel
        Joins the specified multicast group at the specified interface.
        Specified by:
        joinGroup in interface DatagramChannel
      • joinGroup

        public ChannelFuture joinGroup​(java.net.InetAddress multicastAddress,
                                       java.net.NetworkInterface networkInterface,
                                       java.net.InetAddress source)
        Joins the specified multicast group at the specified interface using the specified source.
      • leaveGroup

        public ChannelFuture leaveGroup​(java.net.InetSocketAddress multicastAddress,
                                        java.net.NetworkInterface networkInterface)
        Description copied from interface: DatagramChannel
        Leaves a multicast group on a specified local interface.
        Specified by:
        leaveGroup in interface DatagramChannel
      • leaveGroup

        public ChannelFuture leaveGroup​(java.net.InetAddress multicastAddress,
                                        java.net.NetworkInterface networkInterface,
                                        java.net.InetAddress source)
        Leave the specified multicast group at the specified interface using the specified source.
      • block

        public ChannelFuture block​(java.net.InetAddress multicastAddress,
                                   java.net.NetworkInterface networkInterface,
                                   java.net.InetAddress sourceToBlock)
        Block the given sourceToBlock address for the given multicastAddress on the given networkInterface
      • block

        public ChannelFuture block​(java.net.InetAddress multicastAddress,
                                   java.net.InetAddress sourceToBlock)
        Block the given sourceToBlock address for the given multicastAddress
      • getLocalSocketAddress

        java.net.InetSocketAddress getLocalSocketAddress()
                                                  throws java.lang.Exception
        Specified by:
        getLocalSocketAddress in class AbstractNioChannel<java.nio.channels.DatagramChannel>
        Throws:
        java.lang.Exception
      • getRemoteSocketAddress

        java.net.InetSocketAddress getRemoteSocketAddress()
                                                   throws java.lang.Exception
        Specified by:
        getRemoteSocketAddress in class AbstractNioChannel<java.nio.channels.DatagramChannel>
        Throws:
        java.lang.Exception
      • write

        public ChannelFuture write​(java.lang.Object message,
                                   java.net.SocketAddress remoteAddress)
        Description copied from interface: Channel
        Sends a message to this channel asynchronously. It has an additional parameter that allows a user to specify where to send the specified message instead of this channel's current remote address. If this channel was created by a connectionless transport (e.g. DatagramChannel) and is not connected yet, you must specify non-null address. Otherwise, the write request will fail with NotYetConnectedException and an 'exceptionCaught' event will be triggered.
        Specified by:
        write in interface Channel
        Overrides:
        write in class AbstractChannel
        Parameters:
        message - the message to write
        remoteAddress - where to send the specified message. This method is identical to Channel.write(Object) if null is specified here.
        Returns:
        the ChannelFuture which will be notified when the write request succeeds or fails