Class UnixSocketTransport

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

    public class UnixSocketTransport
    extends AbstractUnixTransport
    Transport type representing a transport connection to a unix socket.
    Since:
    v3.2.0 - 2019-02-08
    • Field Detail

      • unixSocketAddress

        private final jnr.unixsocket.UnixSocketAddress unixSocketAddress
      • socket

        private jnr.unixsocket.UnixSocketChannel socket
      • serverSocket

        private jnr.unixsocket.UnixServerSocketChannel serverSocket
    • Method Detail

      • hasFileDescriptorSupport

        protected boolean hasFileDescriptorSupport()
        Description copied from class: AbstractTransport
        Method to indicate if passing of file descriptors is allowed.
        Specified by:
        hasFileDescriptorSupport in class AbstractTransport
        Returns:
        true to allow FD passing, false otherwise
      • connectImpl

        public java.nio.channels.SocketChannel connectImpl()
                                                    throws java.io.IOException
        Establish a connection to DBus using unix sockets.
        Specified by:
        connectImpl in class AbstractTransport
        Throws:
        java.io.IOException - on error
      • 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 AbstractTransport
        Throws:
        java.io.IOException
      • isAbstractAllowed

        @Deprecated
        protected boolean isAbstractAllowed()
        Deprecated.
        Description copied from class: AbstractTransport
        Return true if the transport supports 'abstract' sockets.
        Specified by:
        isAbstractAllowed in class AbstractTransport
        Returns:
        true if abstract sockets supported, false otherwise
      • getUid

        public int getUid​(java.nio.channels.SocketChannel _sock)
                   throws java.io.IOException
        Specified by:
        getUid in class AbstractUnixTransport
        Throws:
        java.io.IOException