Class NGUnixDomainServerSocket

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class NGUnixDomainServerSocket
    extends java.net.ServerSocket
    Implements a ServerSocket which binds to a local Unix domain socket and returns instances of NGUnixDomainSocket from accept().
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int backlog  
      private static int DEFAULT_BACKLOG  
      private java.util.concurrent.atomic.AtomicInteger fd  
      private boolean isBound  
      private boolean isClosed  
    • Constructor Summary

      Constructors 
      Constructor Description
      NGUnixDomainServerSocket()
      Constructs an unbound Unix domain server socket.
      NGUnixDomainServerSocket​(int backlog)
      Constructs an unbound Unix domain server socket with the specified listen backlog.
      NGUnixDomainServerSocket​(int backlog, java.lang.String path)
      Constructs and binds a Unix domain server socket to the specified path with the specified listen backlog.
      NGUnixDomainServerSocket​(java.lang.String path)
      Constructs and binds a Unix domain server socket to the specified path.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.Socket accept()  
      void bind​(java.net.SocketAddress endpoint)  
      void close()  
      • Methods inherited from class java.net.ServerSocket

        bind, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • fd

        private final java.util.concurrent.atomic.AtomicInteger fd
      • backlog

        private final int backlog
      • isBound

        private boolean isBound
      • isClosed

        private boolean isClosed
    • Constructor Detail

      • NGUnixDomainServerSocket

        public NGUnixDomainServerSocket()
                                 throws java.io.IOException
        Constructs an unbound Unix domain server socket.
        Throws:
        java.io.IOException
      • NGUnixDomainServerSocket

        public NGUnixDomainServerSocket​(int backlog)
                                 throws java.io.IOException
        Constructs an unbound Unix domain server socket with the specified listen backlog.
        Throws:
        java.io.IOException
      • NGUnixDomainServerSocket

        public NGUnixDomainServerSocket​(java.lang.String path)
                                 throws java.io.IOException
        Constructs and binds a Unix domain server socket to the specified path.
        Throws:
        java.io.IOException
      • NGUnixDomainServerSocket

        public NGUnixDomainServerSocket​(int backlog,
                                        java.lang.String path)
                                 throws java.io.IOException
        Constructs and binds a Unix domain server socket to the specified path with the specified listen backlog.
        Throws:
        java.io.IOException
    • Method Detail

      • bind

        public void bind​(java.net.SocketAddress endpoint)
                  throws java.io.IOException
        Overrides:
        bind in class java.net.ServerSocket
        Throws:
        java.io.IOException
      • accept

        public java.net.Socket accept()
                               throws java.io.IOException
        Overrides:
        accept in class java.net.ServerSocket
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.net.ServerSocket
        Throws:
        java.io.IOException