Class BSDV4NativeSocket

  • All Implemented Interfaces:
    java.lang.AutoCloseable

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

      • BSDV4NativeSocket

        public BSDV4NativeSocket​(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_in address,
                        int address_len)
                 throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • socket

        public int socket​(int domain,
                          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_in 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_in 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 java.io.IOException
        Specified by:
        setTrafficClass in class NativeDatagramSocket
        Throws:
        java.io.IOException
      • 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