1. Connection Handlers: 同连接相关的Handler
Event | Signature | Version |
Socket Initial: 套接字初始化 | socket_init(connection_hdl, asio::ip::tcp::socket&) |
>0.3.0 Asio Transport |
TCP established, no data sent: TCP创建,非数据传输 | tcp_pre_init(connection_hdl) |
>0.3.0 Asio Transport |
Request for TLS context: 请求TLS Context | tls_context_ptr tls_init(connection_hdl) |
>0.3.0 Asio Transport With TLS |
Hook to accept or reject a connection: 接受或拒接连接 | bool validate(connection_hdl) |
>0.3.0 Core, Server Role only |
Successful new connection(opening):连接打开 | open(connection_hdl) |
>0.3.0 Core |
Connection failed (before opening):连接失败 | fail(connection_hdl) |
>0.3.0 Core |
Connection closed (after opening): 连接关闭 | close(connection_hdl) |
>0.3.0 Core |
2. Message Handlers: 同数据接收相关的Handler
Event | Signature | Version |
Data message recieved:接收到数据 | message(connection_hdl, message_ptr) |
>0.3.0 Core |
Ping recieved: 接收到Ping数据 | bool ping(connection_hdl, std::string) |
>0.3.0 Core |
Pong recieved: 接收到Pong数据 | bool pong(connection_hdl, std::string) |
>0.3.0 Core |
Timed out while waiting for a pong: 等待Pong数据超时 | pong_timeout(connection_hdl, std::string) |
>0.3.0 Core, transport with timer support |
HTTP request recieved: 接收到Http请求 | http(connection_hdl) |
>0.3.0 Core, Server role only |
Connection was manually interrupted: 连接被手动中断 | interrupt(connection_hdl) |
>0.3.0 Core |
来源:oschina
链接:https://my.oschina.net/u/4355739/blog/3233048