소스 검색

Update doc

ithewei 3 년 전
부모
커밋
6aa28bd961
3개의 변경된 파일17개의 추가작업 그리고 13개의 파일을 삭제
  1. 10 9
      README-CN.md
  2. 5 4
      README.md
  3. 2 0
      docs/PLAN.md

+ 10 - 9
README-CN.md

@@ -50,7 +50,8 @@
 - 跨平台(Linux, Windows, MacOS, BSD, Solaris, Android, iOS)
 - 高性能事件循环(网络IO事件、定时器事件、空闲事件、自定义事件)
 - TCP/UDP服务端/客户端/代理
-- TCP支持心跳、转发、拆包、多线程安全write和close等特性
+- TCP支持心跳、重连、转发、多线程安全write和close等特性
+- 内置常见的拆包模式(固定包长、分界符、头部长度字段)
 - 可靠UDP支持: WITH_KCP
 - SSL/TLS加密通信(可选WITH_OPENSSL、WITH_GNUTLS、WITH_MBEDTLS)
 - HTTP服务端/客户端(支持https http1/x http2 grpc)
@@ -370,12 +371,12 @@ int main(int argc, char** argv) {
     ws.onopen = []() {
         printf("onopen\n");
     };
-    ws.onclose = []() {
-        printf("onclose\n");
-    };
     ws.onmessage = [](const std::string& msg) {
         printf("onmessage: %s\n", msg.c_str());
     };
+    ws.onclose = []() {
+        printf("onclose\n");
+    };
 
     // reconnect: 1,2,4,8,10,10,10...
     reconn_setting_t reconn;
@@ -404,17 +405,17 @@ int main(int argc, char** argv) {
 ## 🍭 更多示例
 
 ### c版本
-- 事件循环: [examples/hloop_test.c](examples/hloop_test.c)
+- 事件循环:     [examples/hloop_test.c](examples/hloop_test.c)
 - TCP回显服务:  [examples/tcp_echo_server.c](examples/tcp_echo_server.c)
 - TCP聊天服务:  [examples/tcp_chat_server.c](examples/tcp_chat_server.c)
 - TCP代理服务:  [examples/tcp_proxy_server.c](examples/tcp_proxy_server.c)
 - UDP回显服务:  [examples/udp_echo_server.c](examples/udp_echo_server.c)
 - UDP代理服务:  [examples/udp_proxy_server.c](examples/udp_proxy_server.c)
 - SOCKS5代理服务: [examples/socks5_proxy_server.c](examples/socks5_proxy_server.c)
-- TinyHttpd示例:[examples/tinyhttpd.c](examples/tinyhttpd.c)
-- TinyProxyd示例:[examples/tinyproxyd.c](examples/tinyproxyd.c)
+- HTTP服务:     [examples/tinyhttpd.c](examples/tinyhttpd.c)
+- HTTP代理服务: [examples/tinyproxyd.c](examples/tinyproxyd.c)
 - jsonRPC示例:  [examples/jsonrpc](examples/jsonrpc)
-- MQTT示例: [examples/mqtt](examples/mqtt)
+- MQTT示例:     [examples/mqtt](examples/mqtt)
 - 多accept进程模式: [examples/multi-thread/multi-acceptor-processes.c](examples/multi-thread/multi-acceptor-processes.c)
 - 多accept线程模式: [examples/multi-thread/multi-acceptor-threads.c](examples/multi-thread/multi-acceptor-threads.c)
 - 一个accept线程+多worker线程: [examples/multi-thread/one-acceptor-multi-workers.c](examples/multi-thread/one-acceptor-multi-workers.c)
@@ -439,7 +440,7 @@ int main(int argc, char** argv) {
 - 网络扫描工具: [examples/nmap](examples/nmap)
 - HTTP服务程序: [examples/httpd](examples/httpd)
 - HTTP压测工具: [examples/wrk](examples/wrk.cpp)
-- URL请求工具: [examples/curl](examples/curl.cpp)
+- URL请求工具:  [examples/curl](examples/curl.cpp)
 - 文件下载工具: [examples/wget](examples/wget.cpp)
 - 服务注册与发现: [examples/consul](examples/consul)
 

+ 5 - 4
README.md

@@ -26,7 +26,8 @@ but simpler api and richer protocols.
 - Cross-platform (Linux, Windows, MacOS, BSD, Solaris, Android, iOS)
 - High-performance EventLoop (IO, timer, idle, custom)
 - TCP/UDP client/server/proxy
-- TCP supports heartbeat, upstream, unpack, MultiThread-safe write and close, etc.
+- TCP supports heartbeat, reconnect, upstream, MultiThread-safe write and close, etc.
+- Built-in common unpacking modes (FixedLength, Delimiter, LengthField)
 - RUDP support: WITH_KCP
 - SSL/TLS support: (via WITH_OPENSSL or WITH_GNUTLS or WITH_MBEDTLS)
 - HTTP client/server (support https http1/x http2 grpc)
@@ -333,12 +334,12 @@ int main(int argc, char** argv) {
     ws.onopen = []() {
         printf("onopen\n");
     };
-    ws.onclose = []() {
-        printf("onclose\n");
-    };
     ws.onmessage = [](const std::string& msg) {
         printf("onmessage: %s\n", msg.c_str());
     };
+    ws.onclose = []() {
+        printf("onclose\n");
+    };
 
     // reconnect: 1,2,4,8,10,10,10...
     reconn_setting_t reconn;

+ 2 - 0
docs/PLAN.md

@@ -22,8 +22,10 @@
 - js binding
 - hrpc = libhv + protobuf
 - rudp: FEC, ARQ, KCP, UDT, QUIC
+- kcptun
 - have a taste of io_uring
 - coroutine
+- cppsocket.io
 - IM-libhv
 - MediaServer-libhv
 - GameServer-libhv