From 2ce50e24d68e684d4feac169a4d0f1abc80f5e2c Mon Sep 17 00:00:00 2001 From: hevake_lcj Date: Mon, 18 Jul 2022 11:49:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmain/example=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E4=B8=8B=E7=9A=84=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/example/00_empty/Makefile | 1 + main/example/01_one_app/Makefile | 1 + main/example/02_more_than_one_apps/Makefile | 1 + main/example/03_nc_client_and_echo_server/Makefile | 1 + main/example/03_nc_client_and_echo_server/echo_server/app.cpp | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main/example/00_empty/Makefile b/main/example/00_empty/Makefile index 7bba09d..6bdfcde 100644 --- a/main/example/00_empty/Makefile +++ b/main/example/00_empty/Makefile @@ -6,6 +6,7 @@ TARGET := sample CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/01_one_app/Makefile b/main/example/01_one_app/Makefile index 6f47669..577137d 100644 --- a/main/example/01_one_app/Makefile +++ b/main/example/01_one_app/Makefile @@ -6,6 +6,7 @@ TARGET := sample CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/02_more_than_one_apps/Makefile b/main/example/02_more_than_one_apps/Makefile index e40bc78..92b8ff5 100644 --- a/main/example/02_more_than_one_apps/Makefile +++ b/main/example/02_more_than_one_apps/Makefile @@ -12,6 +12,7 @@ include app3/app.mk CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/03_nc_client_and_echo_server/Makefile b/main/example/03_nc_client_and_echo_server/Makefile index 840f903..3b9206c 100644 --- a/main/example/03_nc_client_and_echo_server/Makefile +++ b/main/example/03_nc_client_and_echo_server/Makefile @@ -11,6 +11,7 @@ include echo_server/app.mk CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/03_nc_client_and_echo_server/echo_server/app.cpp b/main/example/03_nc_client_and_echo_server/echo_server/app.cpp index bc556e8..05591ac 100644 --- a/main/example/03_nc_client_and_echo_server/echo_server/app.cpp +++ b/main/example/03_nc_client_and_echo_server/echo_server/app.cpp @@ -31,7 +31,7 @@ bool App::onInit(const tbox::Json &cfg) if (!js_bind.is_string()) return false; - if (!server_->initialize(SockAddr::FromString(js_bind.get()))) + if (!server_->initialize(SockAddr::FromString(js_bind.get()), 2)) return false; server_->setReceiveCallback( -- Gitee From 924adf961187a7e631e9fe451a33967bbae17493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E5=8D=AB=E5=93=A5?= Date: Mon, 18 Jul 2022 03:56:46 +0000 Subject: [PATCH 2/3] update README.md. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 53115be..740bb03 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ cpp\_tbox,全称: C++ Treasure Box,C++开发百宝箱,是基于事件的 | 库名 | 依赖模块 | 说明 | 安装方法 | |:----:|:--------:|:----:|:--------:| | googletest | 所有模块 | 单元测试用,如果不进行单元测试可忽略 | sudo apt install google-mock | -| libevent | event | 在event/config.mk中开启了WITH\_LIBEVENT时依赖 | sudo apt install libevent-dev | -| libev | event | 在event/config.mk中开启了WITH\_LIBEV时依赖 | sudo apt install libev-dev | -| mosquitto | mqtt | MQTT client库 | sudo apt install libmosquitto-dev | -| nlohmann/json | main | 作为配置数据用 | 下载json\_fwd.hpp与json.hpp 到/usr/local/include/nlohmann/。[json\_fwd.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/include/nlohmann/json_fwd.hpp), [json.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/single_include/nlohmann/json.hpp) | +| libevent | event | 默认不依赖,在event/config.mk中开启了WITH\_LIBEVENT时依赖 | sudo apt install libevent-dev | +| libev | event | 默认不依赖,在event/config.mk中开启了WITH\_LIBEV时依赖 | sudo apt install libev-dev | +| mosquitto | mqtt | MQTT库 | sudo apt install libmosquitto-dev | +| nlohmann/json | main | 作为配置数据用 | 下载[json\_fwd.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/include/nlohmann/json_fwd.hpp)与[json.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/single_include/nlohmann/json.hpp)到/usr/local/include/nlohmann/ | **安装命令** -- Gitee From ab6801d8519bd36a2c89b41ec590f01d3e0d26b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E5=8D=AB=E5=93=A5?= Date: Mon, 18 Jul 2022 03:58:22 +0000 Subject: [PATCH 3/3] update README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 740bb03..07d534f 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ cpp\_tbox,全称: C++ Treasure Box,C++开发百宝箱,是基于事件的 | libevent | event | 默认不依赖,在event/config.mk中开启了WITH\_LIBEVENT时依赖 | sudo apt install libevent-dev | | libev | event | 默认不依赖,在event/config.mk中开启了WITH\_LIBEV时依赖 | sudo apt install libev-dev | | mosquitto | mqtt | MQTT库 | sudo apt install libmosquitto-dev | -| nlohmann/json | main | 作为配置数据用 | 下载[json\_fwd.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/include/nlohmann/json_fwd.hpp)与[json.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/single_include/nlohmann/json.hpp)到/usr/local/include/nlohmann/ | +| nlohmann/json | main | 作为配置数据用 | 下载[json\_fwd.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/include/nlohmann/json_fwd.hpp)与[json.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/single_include/nlohmann/json.hpp)到头文件目录,如:/usr/local/include/nlohmann/ | **安装命令** -- Gitee