first time create Readme.md
a Concurrency and throughput test experiment process with boost_1_69, can use console to control.
simple connection to server:
- logs in just with username (no password)
- all connections are initiated by the client: client asks, server answers
- server disconnects any client that hasn't pinged for XXX seconds (timeout )
- gets a list of all connected clients
- ping: the server answers either with "ping ok from srv" or "ping client_list_changed"
=========================================================
this project is used for learn how to use boost.asio in Qt
there are some differents between asio(lib) and boost.asio . see
Asio comes in two variants: (non-Boost) Asio and Boost.Asio. The differences between the two are outlined below.
我这里使用的是boost1.69.0,其他的版本也是一样的
打开安装Qt 后的命令行工具Qt X.X for Desktop ,进入boost库所在的目录 找到build.bat,然后执行以下命令编译b2和bjam
我的build.bat在 daemon_with_boost_1_69\boost_1_69_0\tools\build\src\engine
编译完之后在当前目录会生成一个bin.ntx86的目录,进入后有b2.exe和bjam.exe可执行文件,将这两个文件拷贝到boost源代码的根目录下
(--toolset= 选择工具集 --with-选择性编译需要的boost相关库 boost.asio 可能会依赖以下, --prefix安装位置 还可使用 --show-libraries 看有哪些库可以用--with来编译)
(bjam --show-libraries 列出所有的库)
(1、安装路径:--prefix=) 默认:C:/Boost(Linux:/usr/local)
(2、库文件安装路径:--libdir=) 默认:/lib
(3、头文件安装路径:--includedir=) 默认:/include
(4、构建类型:--build-type=) debug release shared static mutil
(5、中间文件存放路径:--build-dir=DIR) 默认:Boost根目录
(6、指定编译器:--toolset=toolset)
bjam --toolset=gcc --with-system
--with-thread (有用到 boost::thread 里的要包括)
--with-program_options (程序里 qcmd_pairs_dealer 有用到 命令行处理的类 要包括)
--with-filesystem (程序里 boost::filesystem::basename() 有用到 命令行处理的类 要包括)
--prefix=D:\XXX\XXX install
包含 boost 相关头文件(hpp文件已经包含了声明以及实现)
INCLUDEPATH += ../boost_1_69_0_builded_installed/include/boost-1_69
INCLUDEPATH += ./3rd_src
INCLUDEPATH += ./include/stpool_include
LIBS += -L./3rd_lib/stpool_lib -lstpool
win32{
LIBS += -lws2_32 -lwsock32
}
unix{
}
LIBS += -L../boost_1_69_0_builded_installed/lib
##(程序里 qcmd_pairs_dealer 有用到 命令行处理的类 要包括)
-lboost_program_options-mgw53-mt-x32-1_69
-lboost_regex-mgw53-mt-x32-1_69
-lboost_filesystem-mgw53-mt-x32-1_69 \
测试时有用到 boost/thread.hpp 下属的库
-lboost_thread-mgw53-mt-x32-1_69