websocket++序列: Handler

雨燕双飞 提交于 2020-04-13 17:05:07

【今日推荐】:为什么一到面试就懵逼!>>>

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
发布了211 篇原创文章 · 获赞 109 · 访问量 32万+
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!