-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
github-actions[bot] edited this page Jul 12, 2026
·
7 revisions
wknet::http / websocket / crypto / codec
│
http_api 薄桥
│
session
┌─────────┼─────────┐
transport http1/http2 ws
│ │ │
net tls codec
└─────────────┴───────┘
rtl
-
http_api只做参数映射、opaque handle 包装和公共生命周期桥接。 -
session拥有路由、重定向、代理、连接池、异步和 HTTP/WebSocket 编排策略。 -
transport::Transport*是协议层与真实 I/O 之间的 opaque 服务边界;协议层不直接操作 WSK IRP 或传输布局。 -
net只提供 WSK 生命周期、解析和字节流能力。 -
tls只处理握手、记录保护、会话恢复和证书验证。 -
http1、http2、ws负责协议状态机,不拥有连接池策略。
wknet::http::SendEx
→ http_api 参数映射
→ session::HttpSend
→ HttpRoute / HttpProxy / ConnectionPool
→ HttpH1Dispatch 或 HttpH2Dispatch
→ transport::TransportSend/Receive
→ WSK 或 TLS
WebSocket 连接由 session::WsConnect 编排,HTTP/1.1 Upgrade 与 RFC 8441 共用同一 TLS、连接与取消模型。
-
ConnectionPool.cpp是池字段的唯一写入者。 -
WskClient、WskSocket、Transport、TlsConnection、Http2Connection与PooledConnection的布局只存在于所属模块私有头。 - Workspace 与协议聚合缓冲使用堆内存;高频缓冲常驻并复用。
-
src/wknetlib不使用.inc实现分片,每个职责由独立.cpp编译。 - 不存在独立 client 层或第二套网络连接生命周期。
wknet::http / websocket / crypto / codec
│
thin http_api bridge
│
session
┌─────────┼─────────┐
transport http1/http2 ws
│ │ │
net tls codec
└─────────────┴───────┘
rtl
-
http_apimaps parameters and wraps opaque public handles. -
sessionowns routing, redirects, proxy policy, pooling, async work, and HTTP/WebSocket orchestration. - opaque
transport::Transport*services are the only I/O seam used by protocol layers. -
netowns WSK lifecycle, resolution, sockets, and byte-stream operations. -
tlsowns handshakes, record protection, resumption, and certificate validation. -
http1,http2, andwsown protocol state machines, not pooling policy.
wknet::http::SendEx
→ public argument mapping
→ session::HttpSend
→ HttpRoute / HttpProxy / ConnectionPool
→ HttpH1Dispatch or HttpH2Dispatch
→ transport::TransportSend/Receive
→ WSK or TLS
WebSocket connections are orchestrated by session::WsConnect; HTTP/1.1 Upgrade and RFC 8441 share the same TLS, connection, and cancellation model.
-
ConnectionPool.cppis the sole writer of pool fields. - Layouts for
WskClient,WskSocket,Transport,TlsConnection,Http2Connection, andPooledConnectionexist only in their owning module's private header. - Workspace and aggregate protocol buffers are heap-backed; hot buffers are retained and reused.
-
src/wknetlibcontains no.incimplementation fragments; responsibilities compile as independent.cppunits. - There is no separate client layer or second network lifecycle.
-
开始使用 / Get Started
-
概念与行为 / Concepts
-
协议指南 / Protocols
-
API 参考 / API Reference
-
贡献与项目 / Contribute