|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
per-message deflate 压缩/解压器 更多...
#include <websocket_deflate.hpp>
Public 成员函数 | |
| websocket_deflate (bool compress, int window_bits, bool no_context_takeover) | |
| 构造压缩/解压器 | |
| string | process (string_view data, bool is_final) |
| 处理消息(压缩或解压) | |
| void | reset_context () |
| 重置上下文(新消息开始时调用) | |
per-message deflate 压缩/解压器
每个 WebSocket 会话持有两个实例:
支持上下文接管优化(跨消息复用 zlib 流状态)。
在文件 websocket_deflate.hpp 第 72 行定义.
| neforce::http::websocket_deflate::websocket_deflate | ( | bool | compress, |
| int | window_bits, | ||
| bool | no_context_takeover ) |
构造压缩/解压器
| compress | true=压缩模式, false=解压模式 |
| window_bits | 窗口比特位 (8-15) |
| no_context_takeover | 每消息结束后是否重置上下文 |
引用了 websocket_deflate().
被这些函数引用 reset_context() , 以及 websocket_deflate().
| string neforce::http::websocket_deflate::process | ( | string_view | data, |
| bool | is_final ) |
处理消息(压缩或解压)
| data | 输入数据 |
| is_final | 是否最终片段 |
引用了 neforce::data() , 以及 process().
被这些函数引用 process() , 以及 reset_context().