# Asio samples
[![Release](https://img.shields.io/github/release/mabrarov/asio_samples.svg)](https://github.com/mabrarov/asio_samples/releases/latest)
[![License](https://img.shields.io/badge/license-BSL%201.0-brightgreen.svg)](https://github.com/mabrarov/asio_samples/tree/master/LICENSE)
Branch | Linux | Windows | Coverage | Coverity Scan
-------|-------|---------|----------|--------------
[master](https://github.com/mabrarov/asio_samples/tree/master) | [![Travis CI build status](https://travis-ci.com/mabrarov/asio_samples.svg?branch=master)](https://travis-ci.com/mabrarov/asio_samples) | [![AppVeyor CI build status](https://ci.appveyor.com/api/projects/status/m3m15b3wxkyhqfj2/branch/master?svg=true)](https://ci.appveyor.com/project/mabrarov/asio-samples) | [![Code coverage status](https://codecov.io/gh/mabrarov/asio_samples/branch/master/graph/badge.svg)](https://codecov.io/gh/mabrarov/asio_samples/branch/master) | [![Coverity Scan status](https://scan.coverity.com/projects/9191/badge.svg)](https://scan.coverity.com/projects/mabrarov-asio_samples)
[develop](https://github.com/mabrarov/asio_samples/tree/develop) | [![Travis CI build status](https://travis-ci.com/mabrarov/asio_samples.svg?branch=develop)](https://travis-ci.com/mabrarov/asio_samples) | [![AppVeyor CI build status](https://ci.appveyor.com/api/projects/status/m3m15b3wxkyhqfj2/branch/develop?svg=true)](https://ci.appveyor.com/project/mabrarov/asio-samples) | [![Code coverage status](https://codecov.io/gh/mabrarov/asio_samples/branch/develop/graph/badge.svg)](https://codecov.io/gh/mabrarov/asio_samples/branch/develop) | |
Extended examples for [Boost.Asio](http://www.boost.org/doc/libs/release/doc/html/boost_asio.html).
## Building with Docker container
Refer to [docker/builder/README.md](docker/builder/README.md) for instruction on how to build Linux version with existing Docker images.
## Build manual
### Prerequisites
* C++ toolchain (one of):
* MinGW with MSYS make
MinGW-W64 4.9+
* Visual Studio (Visual C++)
2008, 2010, 2012, 2013, 2015, 2017, 2019 are tested versions
* GCC with make
4.6+
* Clang with make
3.6+
* [CMake](https://cmake.org/)
3.1+, consider using the latest version of CMake because it supports recent versions of libraries
* [Boost](https://www.boost.org)
1.47+, the latest tested version is 1.74
* [Google Test](https://github.com/google/googletest)
Optional, copy of 1.7.0 version is shipped with this project and is used if no other instance is found
* [Qt](https://www.qt.io)
Optional, 4.0+, both 4.x and 5.x are supported with default preference to 5.x
* [ICU](http://site.icu-project.org/home)
Optional, required if static Qt 5.x is used, version should match Qt requirements / version which was used to build static Qt
### Assumptions
* `%...%` syntax is used for Windows Command Prompt and `${...}` syntax is used for *nix shell
* Windows Command Prompt with configured Windows SDK environment is used on Windows
* Directory with generated project files and with built binaries is specified in `asio_samples_build_dir` environment variable
* This repository is cloned into directory specified in `asio_samples_home_dir` environment variable
* ICU is located at directory specified by `icu_home_dir` environment variable
* Header files of Boost are located at directory specified by `boost_headers_dir` environment variable
* Binary files of Boost are located at directory specified by `boost_libs_dir` environment variable
* Qt 5.x is located at directory specified by `qt5_home_dir` environment variable
* Qt 4.x is located at directory specified by `qt4_home_dir` environment variable
* Google Test is located at directory specified by `gtest_home_dir` environment variable
* [build type](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) is specified in `build_type` environment variable and is one of:
* Debug
* Release
* RelWithDebInfo
* MinSizeRel
* `cmake_generator` environment variable is [CMake generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
* `Visual Studio 14 2015` - Visual Studio 2015
* `Visual Studio 15 2017` - Visual Studio 2017
* `Visual Studio 16 2019` - Visual Studio 2019
* `Visual Studio 12 2013` - Visual Studio 2013
* `Visual Studio 10 2010` - Visual Studio 2010
* `Visual Studio 9 2008` - Visual Studio 2008
* `NMake Makefiles` - NMake
* `MinGW Makefiles` - MinGW makefiles
* `Unix Makefiles` - *nix makefiles
* `cmake_platform` environment variable is [CMAKE_GENERATOR_PLATFORM](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_PLATFORM.html)
* `Win32` - x86 platform when using Visual Studio
* `x64` - amd64 (x64) platform when using Visual Studio
Building of CMake project is usually performed in 2 steps:
1. [Generation of project for build system](#generation-of-project-for-build-system)
1. [Building generated project with build system](#building-generated-project-with-build-system)
### Generation of project for build system
Assuming current directory is `asio_samples_build_dir`.
Windows Command Prompt, Visual Studio CMake generator:
```cmd
cmake ... -G "%cmake_generator%" -A "%cmake_platform%" "%asio_samples_home_dir%"
```
Windows Command Prompt, NMake / MinGW makefiles CMake generator
```cmd
cmake ... -G "%cmake_generator%" "%asio_samples_home_dir%"
```
*nix shell
```bash
cmake ... -G "${cmake_generator}" "${asio_samples_home_dir}"
```
where `...` are optional parameters which are described below.
Use `MA_TESTS` CMake variable to exclude tests from build (tests are included by default):
```
cmake -D MA_TESTS=OFF ...
```
CMake project uses CMake find modules, so most of parameters comes from these CMake modules:
* [FindBoost CMake module](http://www.cmake.org/cmake/help/latest/module/FindBoost.html?highlight=findboost)
CMake variables which can be specified in command line to locate and configure Boost:
* `BOOST_INCLUDEDIR` - Boost headers directory
Windows Command Prompt:
```
-D BOOST_INCLUDEDIR="%boost_headers_dir%"
```
*nix shell
```
-D BOOST_INCLUDEDIR="${boost_headers_dir}"
```
* `BOOST_LIBRARYDIR` - Boost libraries directory
Windows Command Prompt:
```
-D BOOST_LIBRARYDIR="%boost_libs_dir%"
```
*nix shell
```
-D BOOST_LIBRARYDIR="${boost_libs_dir}"
```
* `Boost_USE_STATIC_LIBS` - force usage of static Boost, possible values are `ON` (use static libraries) and `OFF` (linkage type depends on platform)
* `Boost_NO_SYSTEM_PATHS` - do not search for Boost in default system locations
* [cmake-qt CMake module](http://www.cmake.org/cmake/help/latest/manual/cmake-qt.7.html) (refer to [Qt cmake manual](http://doc.qt.io/qt-5/cmake-manual.html) also)
CMake variables which can be specified in command line to locate Qt 5.x:
* `Qt5Core_DIR`
Windows Command Prompt:
```
-D Qt5Core_DIR="%qt5_home_dir%/lib/cmake/Qt5Core"
```
*nix shell
```
-D Qt5Core_DIR="${qt5_home_dir}/lib/cmake/Qt5Core"
```
* `Qt5Gui_DIR`
Windows Command Prompt:
```
-D Qt5Gui_DIR="%qt5_home_dir%/lib/cmake/Qt5Gui"
```
*nix shell
```
-D Qt5Gui_DIR="${qt5_home_dir}/lib/cmake/Qt5Gui"
```
* `Qt5Widgets_DIR`
Windows Command Prompt:
```
-D Qt5Widgets_DIR="%qt5_home_dir%/lib/cmake/Qt5Widgets"
```
*nix shell
```
-D Qt5Widgets_DIR="${qt5_home_dir}/lib/cmake/Qt5Widgets"
```
CMake variables which can be specified in command line to locate Qt 4.x:
* `QT_QMAKE_EXECUTABLE` - path to `qmake` executable
Windows Command Prompt:
```
-D QT_QMAKE_EXECUTABLE="%qt4_home_dir%/bin/qmake.exe"
```
*nix shell
```
-D QT_QMAKE_EXECUTABLE="${qt4_home_dir}/bin/qmake.exe"
```
`MA_QT` CMake variable can be used to avoid usage of Qt and to skip examples using Qt.
Possible values are:
* `ON` (default) - search for (require) and us
没有合适的资源?快使用搜索试试~ 我知道了~
asio_samples-master_Boost.Asio高质量例子程序_源码
共552个文件
patch:103个
txt:76个
hpp:70个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 40 浏览量
2021-10-01
08:06:43
上传
评论
收藏 1.96MB RAR 举报
温馨提示
使用例子程序,包括多播,同步,异步,服务器回显,等多个用asio封装的Socket例子
资源详情
资源评论
资源推荐
收起资源包目录
asio_samples-master_Boost.Asio高质量例子程序_源码 (552个子文件)
configure.ac 3KB
Makefile.am 10KB
build.bat 1KB
gtest.cbproj 10KB
gtest_unittest.cbproj 8KB
gtest_main.cbproj 8KB
gtest_unittest.cc 234KB
gtest.cc 180KB
gtest_pred_impl_unittest.cc 76KB
gtest-death-test.cc 50KB
gtest-printers_test.cc 48KB
gtest-death-test_test.cc 42KB
gtest-port_test.cc 38KB
gtest-param-test_test.cc 33KB
gtest_output_test_.cc 32KB
gtest-port.cc 27KB
gtest-filepath_test.cc 23KB
gtest-filepath.cc 14KB
gtest-unittest-api_test.cc 13KB
gtest-printers.cc 12KB
gtest-typed-test_test.cc 11KB
gtest-listener_test.cc 10KB
gtest_stress_test.cc 9KB
gtest-tuple_test.cc 9KB
sample6_unittest.cc 9KB
gtest_catch_exceptions_test_.cc 9KB
gtest_repeat_test.cc 8KB
gtest-options_test.cc 8KB
gtest-test-part_test.cc 7KB
sample8_unittest.cc 7KB
gtest_environment_test.cc 6KB
sample5_unittest.cc 6KB
gtest_xml_output_unittest_.cc 6KB
sample9_unittest.cc 6KB
sample3_unittest.cc 5KB
gtest-message_test.cc 5KB
sample1_unittest.cc 5KB
sample7_unittest.cc 5KB
sample10_unittest.cc 5KB
gtest_premature_exit_test.cc 5KB
gtest_list_tests_unittest_.cc 5KB
gtest-test-part.cc 4KB
gtest-linked_ptr_test.cc 4KB
sample2_unittest.cc 4KB
gtest-typed-test.cc 4KB
gtest-death-test_ex_test.cc 4KB
gtest_env_var_test_.cc 3KB
gtest_filter_unittest_.cc 3KB
gtest_throw_on_failure_ex_test.cc 3KB
gtest_shuffle_test_.cc 3KB
gtest_break_on_failure_unittest_.cc 3KB
gtest_throw_on_failure_test_.cc 3KB
gtest_color_test_.cc 3KB
gtest-param-test2_test.cc 3KB
widget_test.cc 3KB
sample1.cc 2KB
gtest_no_test_unittest.cc 2KB
widget.cc 2KB
sample2.cc 2KB
gtest_all_test.cc 2KB
gtest_sole_header_test.cc 2KB
gtest_prod_test.cc 2KB
gtest-all.cc 2KB
gtest_help_test_.cc 2KB
gtest-typed-test2_test.cc 2KB
gtest_xml_outfile1_test_.cc 2KB
gtest_xml_outfile2_test_.cc 2KB
gtest_link.cc 2KB
sample4.cc 2KB
gtest_uninitialized_test_.cc 2KB
sample4_unittest.cc 2KB
gtest_main_unittest.cc 2KB
gtest_all.cc 2KB
gtest_main.cc 2KB
production.cc 2KB
CHANGES 6KB
FindICU.cmake 17KB
internal_utils.cmake 10KB
internal_utils.cmake 9KB
FindQt5PlatformSupport.cmake 4KB
FindQt5HarfBuzzNG.cmake 4KB
FindQt5FreeType.cmake 4KB
FindQt5PCRE.cmake 3KB
static_cxx_runtime_overrides.cmake 938B
static_c_runtime_overrides.cmake 834B
CONTRIBUTORS 1KB
session_manager.cpp 35KB
main.cpp 35KB
handler_storage_test.cpp 29KB
main.cpp 29KB
session.cpp 26KB
intrusive_list_test.cpp 24KB
intrusive_forward_list_test.cpp 20KB
main.cpp 17KB
mainform.cpp 17KB
config.cpp 14KB
service.cpp 14KB
sp_singleton_test.cpp 11KB
console_signal_service.cpp 11KB
strand_test.cpp 10KB
共 552 条
- 1
- 2
- 3
- 4
- 5
- 6
西西nayss
- 粉丝: 70
- 资源: 4754
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 历届(第1-21届)希望杯数学竞赛初一试题及答案(最新整理).doc全国数学邀请赛(264页资料)
- 水滴.psd
- TokenPocket_V2.1.2_release.apk
- Apache-druid-kafka-rce.yaml
- 半导体行业词汇 相关缩写
- 基于C#的ASP.NET数据库原理及应用技术课程指导平台的开发
- 基于ROS的智能车轨迹跟踪算法的仿真与设计源码运用PID跟踪算法.zip.zip
- Bug Bounty Tip - i春秋Self-XSS变废为宝的奇思妙想
- 1991-2015年全国初中化学竞赛复赛试题汇编(212页)(24年竞赛复赛真题).docx天原杯
- Apache Flink 未授权访问+远程代码执行.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0