Class UnixServerSocket


  • public class UnixServerSocket
    extends java.lang.Object
    Represents a listening UNIX Socket.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      UnixSocket accept()
      Accepts a connection on the ServerSocket.
      void bind​(UnixSocketAddress address)
      Binds a server socket to the given address.
      void bind​(java.lang.String address)
      Binds a server socket to the given address.
      void close()
      Closes the ServerSocket.
      UnixSocketAddress getAddress()
      Return the address this socket is bound to.
      boolean isBound()
      Check the status of the socket.
      boolean isClosed()
      Check the status of the socket.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnixServerSocket

        public UnixServerSocket()
        Create an un-bound server socket.
      • UnixServerSocket

        public UnixServerSocket​(UnixSocketAddress address)
                         throws java.io.IOException
        Create a server socket bound to the given address.
        Parameters:
        address - Path to the socket.
        Throws:
        java.io.IOException
      • UnixServerSocket

        public UnixServerSocket​(java.lang.String address)
                         throws java.io.IOException
        Create a server socket bound to the given address.
        Parameters:
        address - Path to the socket.
        Throws:
        java.io.IOException
    • Method Detail

      • accept

        public UnixSocket accept()
                          throws java.io.IOException
        Accepts a connection on the ServerSocket.
        Returns:
        A UnixSocket connected to the accepted connection.
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Closes the ServerSocket.
        Throws:
        java.io.IOException
      • bind

        public void bind​(UnixSocketAddress address)
                  throws java.io.IOException
        Binds a server socket to the given address.
        Parameters:
        address - Path to the socket.
        Throws:
        java.io.IOException
      • bind

        public void bind​(java.lang.String address)
                  throws java.io.IOException
        Binds a server socket to the given address.
        Parameters:
        address - Path to the socket.
        Throws:
        java.io.IOException
      • getAddress

        public UnixSocketAddress getAddress()
        Return the address this socket is bound to.
        Returns:
        The UnixSocketAddress if bound or null if unbound.
      • isClosed

        public boolean isClosed()
        Check the status of the socket.
        Returns:
        True if closed.
      • isBound

        public boolean isBound()
        Check the status of the socket.
        Returns:
        True if bound.