org.redkale.net

## 类 Transport

- java.lang.Object
- - org.redkale.net.Transport

-     public final class Transport
      extends java.lang.Object

  传输客户端

  详情见: https://redkale.org

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected ObjectPool<java.nio.ByteBuffer>` | `bufferPool`
    `protected java.net.InetSocketAddress` | `clientAddress`
    `protected java.util.concurrent.ConcurrentHashMap<java.net.SocketAddress,java.util.concurrent.BlockingQueue<AsyncConnection>>` | `connPool`
    `static java.lang.String` | `DEFAULT_PROTOCOL`
    `protected java.nio.channels.AsynchronousChannelGroup` | `group`
    `protected java.lang.String` | `kind`
    `protected static int` | `MAX_POOL_LIMIT`
    `protected java.lang.String` | `name`
    `protected java.lang.String` | `protocol`
    `protected java.net.InetSocketAddress[]` | `remoteAddres`
    `protected static boolean` | `supportTcpNoDelay`
    `protected boolean` | `tcp`
    `protected WatchFactory` | `watch`

  - ### 构造器概要

    构造器
    构造器和说明
    `Transport(java.util.Collection<Transport> transports)`
    `Transport(java.lang.String name, java.lang.String protocol, WatchFactory watch, java.lang.String kind, ObjectPool<java.nio.ByteBuffer> transportBufferPool, java.nio.channels.AsynchronousChannelGroup transportChannelGroup, java.net.InetSocketAddress clientAddress, java.util.Collection<java.net.InetSocketAddress> addresses)`
    `Transport(java.lang.String name, WatchFactory watch, java.lang.String kind, ObjectPool<java.nio.ByteBuffer> transportBufferPool, java.nio.channels.AsynchronousChannelGroup transportChannelGroup, java.net.InetSocketAddress clientAddress, java.util.Collection<java.net.InetSocketAddress> addresses)`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `<A> void` | `async(java.net.SocketAddress addr, java.nio.ByteBuffer buffer, A att, java.nio.channels.CompletionHandler<java.lang.Integer,A> handler)`
    `void` | `close()`
    `java.util.function.Supplier<java.nio.ByteBuffer>` | `getBufferSupplier()`
    `java.net.InetSocketAddress` | `getClientAddress()`
    `java.lang.String` | `getKind()`
    `java.lang.String` | `getName()`
    `java.net.InetSocketAddress[]` | `getRemoteAddresses()`
    `boolean` | `isTCP()`
    `void` | `offerBuffer(java.nio.ByteBuffer... buffers)`
    `void` | `offerBuffer(java.nio.ByteBuffer buffer)`
    `void` | `offerConnection(boolean forceClose, AsyncConnection conn)`
    `java.nio.ByteBuffer` | `pollBuffer()`
    `AsyncConnection` | `pollConnection(java.net.SocketAddress addr)`
    `java.lang.String` | `toString()`
    `java.net.InetSocketAddress[]` | `updateRemoteAddresses(java.util.Collection<java.net.InetSocketAddress> addresses)`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 字段详细资料

    - #### DEFAULT_PROTOCOL

          public static final java.lang.String DEFAULT_PROTOCOL

      另请参阅:
        常量字段值

    - #### MAX_POOL_LIMIT

          protected static final int MAX_POOL_LIMIT

    - #### supportTcpNoDelay

          protected static final boolean supportTcpNoDelay

    - #### name

          protected final java.lang.String name

    - #### kind

          protected final java.lang.String kind

    - #### tcp

          protected final boolean tcp

    - #### protocol

          protected final java.lang.String protocol

    - #### watch

          protected final WatchFactory watch

    - #### group

          protected final java.nio.channels.AsynchronousChannelGroup group

    - #### clientAddress

          protected final java.net.InetSocketAddress clientAddress

    - #### remoteAddres

          protected java.net.InetSocketAddress[] remoteAddres

    - #### bufferPool

          protected final ObjectPool<java.nio.ByteBuffer> bufferPool

    - #### connPool

          protected final java.util.concurrent.ConcurrentHashMap<java.net.SocketAddress,java.util.concurrent.BlockingQueue<AsyncConnection>> connPool

  - ### 构造器详细资料

    - #### Transport

          public Transport(java.lang.String name,
                           WatchFactory watch,
                           java.lang.String kind,
                           ObjectPool<java.nio.ByteBuffer> transportBufferPool,
                           java.nio.channels.AsynchronousChannelGroup transportChannelGroup,
                           java.net.InetSocketAddress clientAddress,
                           java.util.Collection<java.net.InetSocketAddress> addresses)

    - #### Transport

          public Transport(java.lang.String name,
                           java.lang.String protocol,
                           WatchFactory watch,
                           java.lang.String kind,
                           ObjectPool<java.nio.ByteBuffer> transportBufferPool,
                           java.nio.channels.AsynchronousChannelGroup transportChannelGroup,
                           java.net.InetSocketAddress clientAddress,
                           java.util.Collection<java.net.InetSocketAddress> addresses)

    - #### Transport

          public Transport(java.util.Collection<Transport> transports)

  - ### 方法详细资料

    - #### updateRemoteAddresses

          public final java.net.InetSocketAddress[] updateRemoteAddresses(java.util.Collection<java.net.InetSocketAddress> addresses)

    - #### getName

          public java.lang.String getName()

    - #### getKind

          public java.lang.String getKind()

    - #### close

          public void close()

    - #### getClientAddress

          public java.net.InetSocketAddress getClientAddress()

    - #### getRemoteAddresses

          public java.net.InetSocketAddress[] getRemoteAddresses()

    - #### toString

          public java.lang.String toString()

      覆盖:
        `toString` 在类中 `java.lang.Object`

    - #### pollBuffer

          public java.nio.ByteBuffer pollBuffer()

    - #### getBufferSupplier

          public java.util.function.Supplier<java.nio.ByteBuffer> getBufferSupplier()

    - #### offerBuffer

          public void offerBuffer(java.nio.ByteBuffer buffer)

    - #### offerBuffer

          public void offerBuffer(java.nio.ByteBuffer... buffers)

    - #### isTCP

          public boolean isTCP()

    - #### pollConnection

          public AsyncConnection pollConnection(java.net.SocketAddress addr)

    - #### offerConnection

          public void offerConnection(boolean forceClose,
                                      AsyncConnection conn)

    - #### async

          public <A> void async(java.net.SocketAddress addr,
                                java.nio.ByteBuffer buffer,
                                A att,
                                java.nio.channels.CompletionHandler<java.lang.Integer,A> handler)