Asiocppcon_add_library(complete LIBRARIES Asio::asio) add_subdirectory(tests)0 码力 | 1 页 | 74.00 B | 1 年前3
CMake Configuration for Asio Basic Library and Testscppcon_add_library(basic LIBRARIES Asio::asio) add_subdirectory(tests)0 码力 | 1 页 | 71.00 B | 1 年前3
CMakeLists.txtcppcon_add_library(async_initiate LIBRARIES Asio::asio) add_subdirectory(tests)0 码力 | 1 页 | 80.00 B | 1 年前3
servicecppcon_add_library(service LIBRARIES Asio::asio) add_subdirectory(tests)0 码力 | 1 页 | 73.00 B | 1 年前3
NoService 库cppcon_add_library(no_service LIBRARIES Asio::asio) add_subdirectory(tests)0 码力 | 1 页 | 76.00 B | 1 年前3
Coroutines and Structured Concurrency in Practicecoroutines A lot of existing code mostly callback-based A custom-built I/O event loop predates Asio by a decade fine-tuned for specific use cases Somewhat conservative audience real benefit needs buf(1024); asio::co_spawn( ex, [&s, &buf() -> asio::awaitable { co_await s.read_some(s, asio::buffer(buf), asio::use_awaitable); asio::detached); } ## Detached tasks considered harmful // don't do this either void slightly_better(tcp::socket& s) { auto buf = make_shared(1024); asio::co_spawn( 0 码力 | 103 页 | 1.98 MB | 1 年前3
deploying the networking TSconfiguration=""> auto with_pool(Configuration& config, thread_pool& pool); void thread_start(asio::io_context& ctx); }; templatestruct connection_state configuration,="" typename="" withpool=""> connection_state(asio::ip::tcp::socket s, asio::ip::tcp::endpoint local, asio::ip::tcp::endpoint remote, Configuration& result->ec.message() << std::endl; } struct accept_state { accept_state(asio::io_context& ctx, asio::ip::tcp::endpoint local) : acceptor(ctx), local(local) { acceptor 0 码力 | 44 页 | 892.77 KB | 1 年前3
CMakeLists.txtcppcon_add_test(no_service SOURCES async_event.cpp main.cpp pending.cpp LIBRARIES Asia::asio Catch2::Catch2 no_service)0 码力 | 1 页 | 122.00 B | 1 年前3
添加测试服务cppcon_add_test(service SOURCES async_event.cpp main.cpp pending.cpp service.cpp LIBRARIES Asio::asio Catch2::Catch2 service)0 码力 | 1 页 | 128.00 B | 1 年前3
CMakeLists.txtcppcon_add_test(async_initiate SOURCES async_event.cpp main.cpp pending.cpp LIBRARIES Asio::asio Catch2::Catch2 async_initiate)0 码力 | 1 页 | 130.00 B | 1 年前3
共 72 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
相关搜索词
Asiocmakecppcon_add_libraryadd_subdirectoryLIBRARIESCMake配置基本库测试CMakeLists.txtasync_initiateAsio::asioasiotestsno_servicecoroutinesstructured concurrencycallback-basedI/O event loopobject lifetime managementNetworking TSasynchronous operationsinjected operationscompletion handlerNetTScppcon_add_testasync_event.cppmain.cpppending.cppAsia::asioCatch2::Catch2serviceSOURCES













