Class BSDV6NativeSocket

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class BSDV6NativeSocket
    extends NativeDatagramSocket
    UnixNativeSocketFactory
    Author:
    brozow
    • Constructor Detail

      • BSDV6NativeSocket

        public BSDV6NativeSocket​(int family,
                                 int type,
                                 int protocol,
                                 int listenPort)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • bind

        public int bind​(int socket,
                        bsd_sockaddr_in6 address,
                        int address_len)
                 throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • socket

        public int socket​(int family,
                          int type,
                          int protocol)
                   throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • setsockopt

        public int setsockopt​(int socket,
                              int level,
                              int option_name,
                              com.sun.jna.Pointer value,
                              int option_len)
        Overrides:
        setsockopt in class NativeDatagramSocket
      • sendto

        public int sendto​(int socket,
                          java.nio.Buffer buffer,
                          int buflen,
                          int flags,
                          bsd_sockaddr_in6 dest_addr,
                          int dest_addr_len)
                   throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • recvfrom

        public int recvfrom​(int socket,
                            java.nio.Buffer buffer,
                            int buflen,
                            int flags,
                            bsd_sockaddr_in6 in_addr,
                            int[] in_addr_len)
                     throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • close

        public int close​(int socket)
                  throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • setTrafficClass

        public void setTrafficClass​(int tc)
                             throws com.sun.jna.LastErrorException
        Specified by:
        setTrafficClass in class NativeDatagramSocket
        Throws:
        com.sun.jna.LastErrorException
      • allowFragmentation

        public void allowFragmentation​(boolean frag)
                                throws java.io.IOException
        Specified by:
        allowFragmentation in class NativeDatagramSocket
        Throws:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in class NativeDatagramSocket