Class NGUnixDomainSocketLibrary


  • public class NGUnixDomainSocketLibrary
    extends java.lang.Object
    Utility class to bridge native Unix domain socket calls to Java using JNA.
    • Constructor Detail

      • NGUnixDomainSocketLibrary

        private NGUnixDomainSocketLibrary()
    • Method Detail

      • socket

        public static int socket​(int domain,
                                 int type,
                                 int protocol)
                          throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • bind

        public static int bind​(int fd,
                               NGUnixDomainSocketLibrary.SockaddrUn address,
                               int addressLen)
                        throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • listen

        public static int listen​(int fd,
                                 int backlog)
                          throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • accept

        public static int accept​(int fd,
                                 NGUnixDomainSocketLibrary.SockaddrUn address,
                                 com.sun.jna.ptr.IntByReference addressLen)
                          throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • read

        public static int read​(int fd,
                               java.nio.ByteBuffer buffer,
                               int count)
                        throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • write

        public static int write​(int fd,
                                java.nio.ByteBuffer buffer,
                                int count)
                         throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • close

        public static int close​(int fd)
                         throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException
      • shutdown

        public static int shutdown​(int fd,
                                   int how)
                            throws com.sun.jna.LastErrorException
        Throws:
        com.sun.jna.LastErrorException