Class TransportConnection

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

    public class TransportConnection
    extends java.lang.Object
    implements java.io.Closeable
    Represents one transport connection of any type.

    A transport connection is bound to a SocketChannel which might be a connection to a DBusServer when used as client or a connection from a client when running as server.

    Since:
    v4.2.2 - 2023-02-02
    • Field Detail

      • TRANSPORT_ID_GENERATOR

        private static final java.util.concurrent.atomic.AtomicLong TRANSPORT_ID_GENERATOR
      • id

        private final long id
      • channel

        private final java.nio.channels.SocketChannel channel
    • Constructor Detail

      • TransportConnection

        public TransportConnection​(java.nio.channels.SocketChannel _channel,
                                   IMessageWriter _writer,
                                   IMessageReader _reader)
    • Method Detail

      • getChannel

        public java.nio.channels.SocketChannel getChannel()
      • getId

        public long getId()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • close

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