ithewei 3 년 전
부모
커밋
4e79b1bc9a
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      BUILD.md
  2. 7 0
      README-CN.md

+ 1 - 1
BUILD.md

@@ -103,7 +103,7 @@ cmake --build . --target hv_static --config Release
 ### compile without c++
 ```
 ./configure --without-evpp
-make clean && make
+make clean && make libhv
 ```
 
 ### compile WITH_OPENSSL

+ 7 - 0
README-CN.md

@@ -272,6 +272,13 @@ int main() {
     return 0;
 }
 ```
+
+**注意**:
+
+上面示例直接运行在`main`主线程,`server.run()`会阻塞当前线程运行,所以`router`和`server`对象不会被析构,
+如使用`server.start()`内部会另起线程运行,不会阻塞当前线程,但需要注意`router`和`server`的生命周期,
+不要定义为局部变量被析构了,可定义为类成员变量或者全局变量,下面的`WebSocket`服务同理。
+
 #### HTTP客户端
 见[examples/http_client_test.cpp](examples/http_client_test.cpp)