Class UnixDatagramChannel

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.InterruptibleChannel, java.nio.channels.MulticastChannel, java.nio.channels.NetworkChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, java.nio.channels.WritableByteChannel, jnr.enxio.channels.NativeSelectableChannel

    public class UnixDatagramChannel
    extends AbstractNativeDatagramChannel
    • Method Detail

      • open

        public static final UnixDatagramChannel open()
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • open

        public static final UnixDatagramChannel open​(jnr.constants.platform.ProtocolFamily domain,
                                                     int protocol)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • pair

        public static final UnixDatagramChannel[] pair()
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • bind

        public UnixDatagramChannel bind​(java.net.SocketAddress local)
                                 throws java.io.IOException
        Specified by:
        bind in interface java.nio.channels.NetworkChannel
        Specified by:
        bind in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • disconnect

        public UnixDatagramChannel disconnect()
                                       throws java.io.IOException
        Specified by:
        disconnect in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • isConnected

        public boolean isConnected()
        Specified by:
        isConnected in class java.nio.channels.DatagramChannel
      • receive

        public UnixSocketAddress receive​(java.nio.ByteBuffer src)
                                  throws java.io.IOException
        Specified by:
        receive in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • send

        public int send​(java.nio.ByteBuffer src,
                        java.net.SocketAddress target)
                 throws java.io.IOException
        Specified by:
        send in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • connect

        public java.nio.channels.DatagramChannel connect​(java.net.SocketAddress remote)
                                                  throws java.io.IOException
        Specified by:
        connect in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • socket

        public UnixDatagramSocket socket()
        Specified by:
        socket in class java.nio.channels.DatagramChannel
      • write

        public long write​(java.nio.ByteBuffer[] srcs,
                          int offset,
                          int length)
                   throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.GatheringByteChannel
        Overrides:
        write in class AbstractNativeDatagramChannel
        Throws:
        java.io.IOException
      • read

        public int read​(java.nio.ByteBuffer dst)
                 throws java.io.IOException
        Specified by:
        read in interface java.nio.channels.ReadableByteChannel
        Overrides:
        read in class AbstractNativeDatagramChannel
        Throws:
        java.io.IOException
      • write

        public int write​(java.nio.ByteBuffer src)
                  throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.WritableByteChannel
        Overrides:
        write in class AbstractNativeDatagramChannel
        Throws:
        java.io.IOException
      • getRemoteAddress

        public java.net.SocketAddress getRemoteAddress()
                                                throws java.io.IOException
        Specified by:
        getRemoteAddress in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • getLocalAddress

        public java.net.SocketAddress getLocalAddress()
                                               throws java.io.IOException
        Specified by:
        getLocalAddress in interface java.nio.channels.NetworkChannel
        Specified by:
        getLocalAddress in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • supportedOptions

        public final java.util.Set<java.net.SocketOption<?>> supportedOptions()
      • getOption

        public <T> T getOption​(java.net.SocketOption<T> name)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • setOption

        public <T> java.nio.channels.DatagramChannel setOption​(java.net.SocketOption<T> name,
                                                               T value)
                                                        throws java.io.IOException
        Specified by:
        setOption in interface java.nio.channels.NetworkChannel
        Specified by:
        setOption in class java.nio.channels.DatagramChannel
        Throws:
        java.io.IOException
      • join

        public java.nio.channels.MembershipKey join​(java.net.InetAddress group,
                                                    java.net.NetworkInterface interf)
      • join

        public java.nio.channels.MembershipKey join​(java.net.InetAddress group,
                                                    java.net.NetworkInterface interf,
                                                    java.net.InetAddress source)