English Core API Quick Reference
A concise English reference for the public APIs used throughout the programming guide.
The generated Doxygen tree is built from the single canonical header. Some detailed source comments are still Chinese. This page provides an English reference for the core public APIs used by the guide; the full generated tree remains available for complete signatures and members.
Server classes
| Class | Core purpose | Most-used methods |
|---|
HttpServer | HTTP/HTTPS server on the TcpServer Reactor. | setFunction, setGlobalSolveFunction, setGetKeyFunction, putTask, startListen, setTLS, close |
WebSocketServer | WS/WSS server with RFC 6455 parsing and heartbeat. | setJudgeFunction, setStartFunction, setGlobalSolveFunction, setFunction, sendMessage, closeFD |
TcpServer | Raw TCP server for custom framed protocols. | setGlobalSolveFunction, setGetKeyFunction, setFunction, putTask, startListen |
UdpServer | Bound UDP socket used with an explicit receive loop. | recvData, sendData, close |
HTTP request and response
| API | Meaning |
|---|
HttpRequestInformation::type | HTTP method. |
locPara / loc / para | Path+query / path only / raw query beginning with ?. |
headerValue(name) | Case-insensitive, non-owning header view. |
bodyView() | Non-owning view of Content-Length or chunked body. |
sendText | Text response with Content-Type and Content-Length. |
sendJson | Serialize Json::Value and send application/json. |
redirect | Location response with CR/LF validation. |
Flow results
| Result | Meaning |
|---|
| 1 | Stage succeeded; continue if another stage exists. |
| 0 | Stage was delegated to WorkerPool. |
| -1 | Remaining stages stop while the connection stays open. |
| -2 | Processing stops and the connection closes. |
Production controls
| API | Purpose |
|---|
setSocketOptions | TCP_NODELAY, keepalive, backlog, buffers, and Linux options. |
setMaxPendingWriteBytes | Per-connection output high-water mark. |
setWriteBudgetPerEvent | Reactor write fairness budget. |
setMaxPendingWorkerTasks | Bound queued blocking work. |
setGracefulShutdownTimeout | Drain deadline for close/stop. |
getMetrics | Lock-free snapshot of connection, queue, send, and overflow counters. |
Complete generated API tree →