完整注释 Demo
19 个示例覆盖网络、JSON、时间、文件日志、协议解析、数据工具、安全、信号、系统设置和进程监督。
每个 Demo 都有独立页面,包含目标、构建命令、验证方法、预期结果和完整源码。中文页面展示中文代码注释;英文页面展示英文代码注释。
HTTP 最小服务
sttnet_http_helloHTTP 请求与 JSONsttnet_http_jsonWorkerPool 阻塞任务sttnet_worker_poolWebSocket 回显sttnet_websocket_echoTCP 字节流回显sttnet_tcp_echoUDP 报文回显sttnet_udp_echoHTTP 客户端sttnet_http_clientWebSocket 客户端sttnet_websocket_clientHTTPS/TLS 服务sttnet_tls_https信号与优雅退出sttnet_signal_shutdown系统设置与指标sttnet_system_settingsJSON 工具类sttnet_json_tools时间工具类sttnet_time_tools文件与异步日志sttnet_file_logging编码与加密sttnet_crypto_encoding数值、随机数与字节序sttnet_data_tools连接与请求限流sttnet_security_limiter进程监督sttnet_process_supervisor协议字符串解析工具sttnet_protocol_parsing