Class UnixSocket

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

    public class UnixSocket
    extends java.net.Socket
    • Method Detail

      • bind

        public void bind​(java.net.SocketAddress local)
                  throws java.io.IOException
        Overrides:
        bind in class java.net.Socket
        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.Socket
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.SocketAddress addr)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.SocketAddress addr,
                            int timeout)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException
      • getChannel

        public java.nio.channels.SocketChannel getChannel()
        Overrides:
        getChannel in class java.net.Socket
      • getInetAddress

        public java.net.InetAddress getInetAddress()
        Overrides:
        getInetAddress in class java.net.Socket
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Overrides:
        getInputStream in class java.net.Socket
        Throws:
        java.io.IOException
      • getLocalSocketAddress

        public java.net.SocketAddress getLocalSocketAddress()
        Overrides:
        getLocalSocketAddress in class java.net.Socket
      • getOutputStream

        public java.io.OutputStream getOutputStream()
                                             throws java.io.IOException
        Overrides:
        getOutputStream in class java.net.Socket
        Throws:
        java.io.IOException
      • getRemoteSocketAddress

        public java.net.SocketAddress getRemoteSocketAddress()
        Overrides:
        getRemoteSocketAddress in class java.net.Socket
      • isBound

        public boolean isBound()
        Overrides:
        isBound in class java.net.Socket
      • isClosed

        public boolean isClosed()
        Overrides:
        isClosed in class java.net.Socket
      • isConnected

        public boolean isConnected()
        Overrides:
        isConnected in class java.net.Socket
      • isInputShutdown

        public boolean isInputShutdown()
        Overrides:
        isInputShutdown in class java.net.Socket
      • isOutputShutdown

        public boolean isOutputShutdown()
        Overrides:
        isOutputShutdown in class java.net.Socket
      • shutdownInput

        public void shutdownInput()
                           throws java.io.IOException
        Overrides:
        shutdownInput in class java.net.Socket
        Throws:
        java.io.IOException
      • shutdownOutput

        public void shutdownOutput()
                            throws java.io.IOException
        Overrides:
        shutdownOutput in class java.net.Socket
        Throws:
        java.io.IOException
      • getCredentials

        public final Credentials getCredentials()
                                         throws java.net.SocketException
        Retrieves the credentials for this UNIX socket. Clients calling this method will receive the server's credentials, and servers will receive the client's credentials. User ID, group ID, and PID are supplied. See man unix 7; SCM_CREDENTIALS
        Returns:
        the credentials of the remote; null if not connected
        Throws:
        java.lang.UnsupportedOperationException - if the underlying socket library doesn't support the SO_PEERCRED option
        java.net.SocketException - if fetching the socket option failed.
      • getKeepAlive

        public boolean getKeepAlive()
                             throws java.net.SocketException
        Overrides:
        getKeepAlive in class java.net.Socket
        Throws:
        java.net.SocketException
      • getReceiveBufferSize

        public int getReceiveBufferSize()
                                 throws java.net.SocketException
        Overrides:
        getReceiveBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • getSendBufferSize

        public int getSendBufferSize()
                              throws java.net.SocketException
        Overrides:
        getSendBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • getSoTimeout

        public int getSoTimeout()
                         throws java.net.SocketException
        Overrides:
        getSoTimeout in class java.net.Socket
        Throws:
        java.net.SocketException
      • setKeepAlive

        public void setKeepAlive​(boolean on)
                          throws java.net.SocketException
        Overrides:
        setKeepAlive in class java.net.Socket
        Throws:
        java.net.SocketException
      • setReceiveBufferSize

        public void setReceiveBufferSize​(int size)
                                  throws java.net.SocketException
        Overrides:
        setReceiveBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • setSendBufferSize

        public void setSendBufferSize​(int size)
                               throws java.net.SocketException
        Overrides:
        setSendBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • setSoTimeout

        public void setSoTimeout​(int timeout)
                          throws java.net.SocketException
        Overrides:
        setSoTimeout in class java.net.Socket
        Throws:
        java.net.SocketException