Class NativeUnixSocketTransport
java.lang.Object
org.freedesktop.dbus.connections.transports.AbstractTransport
org.freedesktop.dbus.connections.transports.AbstractUnixTransport
org.freedesktop.dbus.transport.jre.NativeUnixSocketTransport
- All Implemented Interfaces:
Closeable,AutoCloseable
Transport type representing a transport connection to a unix socket.
This implementation uses features of Java 16+ to connect to a unix
socket without a 3rd party library.
Please note: The functionality of the native unix sockets in Java are
limited. 'Side-channel' communication (e.g. passing file descriptors)
is not possible (unlike using jnr-unix socket + dbus-java-nativefd).
Also using 'abstract' sockets is not possible when using this native implementation.
In most cases this implementation should suit our needs.
If it does not fit for you, use jnr-unixsocket instead.
- Since:
- v4.0.0 - 2021-09-01
- Author:
- hypfvieh
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidbindImpl()protected voidEstablish a connection to DBus using unix sockets.intgetUid(SocketChannel _sock) protected booleanprotected booleanisBound()Methods inherited from class org.freedesktop.dbus.connections.transports.AbstractTransport
close, connect, getAddress, getLogger, getMessageFactory, getSaslConfig, getTransportConfig, getTransportConnection, isConnected, isFileDescriptorSupported, isListening, listen, readMessage, setPreConnectCallback, toString, writeMessage
-
Method Details
-
hasFileDescriptorSupport
protected boolean hasFileDescriptorSupport()- Specified by:
hasFileDescriptorSupportin classAbstractTransport
-
connectImpl
Establish a connection to DBus using unix sockets.- Specified by:
connectImplin classAbstractTransport- Throws:
IOException- on error
-
bindImpl
- Specified by:
bindImplin classAbstractTransport- Throws:
IOException
-
acceptImpl
- Specified by:
acceptImplin classAbstractTransport- Throws:
IOException
-
isBound
protected boolean isBound()- Specified by:
isBoundin classAbstractTransport
-
closeTransport
- Specified by:
closeTransportin classAbstractTransport- Throws:
IOException
-
getUid
- Specified by:
getUidin classAbstractUnixTransport- Throws:
IOException
-