## 类的使用
org.redkale.net.AsyncConnection

- 使用AsyncConnection的程序包
  程序包 | 说明
  --- | ---
  org.redkale.net | 网络TCP/UDP基础服务包
  org.redkale.net.http | HTTP协议包,提供HTTP协议服务器

- - ### org.redkale.net中AsyncConnection的使用

    声明为AsyncConnection的org.redkale.net中的字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected AsyncConnection` | Request.`channel`
    `protected AsyncConnection` | Response.`channel`

    类型参数类型为AsyncConnection的org.redkale.net中的字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected java.util.concurrent.ConcurrentHashMap<java.net.SocketAddress,java.util.concurrent.BlockingQueue<AsyncConnection>>` | Transport.`connPool`

    返回AsyncConnection的org.redkale.net中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static AsyncConnection` | AsyncConnection.`create(java.nio.channels.AsynchronousSocketChannel ch)`
    `static AsyncConnection` | AsyncConnection.`create(java.nio.channels.AsynchronousSocketChannel ch, java.net.SocketAddress addr0, int readTimeoutSecond0, int writeTimeoutSecond0)`
    `static AsyncConnection` | AsyncConnection.`create(java.nio.channels.DatagramChannel ch, java.net.SocketAddress addr, boolean client0, int readTimeoutSecond0, int writeTimeoutSecond0)`
    `static AsyncConnection` | AsyncConnection.`create(java.net.Socket socket)` 通常用于 ssl socket
    `static AsyncConnection` | AsyncConnection.`create(java.net.Socket socket, java.net.SocketAddress addr0, int readTimeoutSecond0, int writeTimeoutSecond0)`
    `static AsyncConnection` | AsyncConnection.`create(java.lang.String protocol, java.nio.channels.AsynchronousChannelGroup group, java.net.SocketAddress address)`
    `static AsyncConnection` | AsyncConnection.`create(java.lang.String protocol, java.nio.channels.AsynchronousChannelGroup group, java.net.SocketAddress address, int readTimeoutSecond0, int writeTimeoutSecond0)` 创建客户端连接
    `AsyncConnection` | Transport.`pollConnection(java.net.SocketAddress addr)`
    `protected AsyncConnection` | Response.`removeChannel()`

    参数类型为AsyncConnection的org.redkale.net中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | Response.`init(AsyncConnection channel)`
    `void` | Transport.`offerConnection(boolean forceClose, AsyncConnection conn)`

    参数类型为AsyncConnection的org.redkale.net中的构造器
    构造器和说明
    `PrepareRunner(Context context, AsyncConnection channel, java.nio.ByteBuffer data)`

  - ### org.redkale.net.http中AsyncConnection的使用

    返回AsyncConnection的org.redkale.net.http中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected AsyncConnection` | HttpRequest.`getChannel()`
    `protected AsyncConnection` | HttpResponse.`removeChannel()`

    参数类型为AsyncConnection的org.redkale.net.http中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | HttpResponse.`init(AsyncConnection channel)`
    `void` | WebSocket.`onRead(AsyncConnection channel)` 标记为WebSocketBinary才需要重写此方法

    参数类型为AsyncConnection的org.redkale.net.http中的构造器
    构造器和说明
    `WebSocketRunner(Context context, WebSocket webSocket, AsyncConnection channel, boolean wsbinary)`