From cd2d553a81fdc7a1e85bc0302d975147236baed1 Mon Sep 17 00:00:00 2001 From: "Zezheng.Li" Date: Fri, 7 Jul 2023 12:14:54 +0800 Subject: [PATCH] fix --- include/ylt/coro_io/client_pool.hpp | 2 +- src/coro_http/examples/channel.cpp | 4 ++-- src/coro_rpc/examples/CMakeLists.txt | 2 +- src/coro_rpc/examples/base_examples/channel.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ylt/coro_io/client_pool.hpp b/include/ylt/coro_io/client_pool.hpp index 3d5dd5205..2398b2872 100644 --- a/include/ylt/coro_io/client_pool.hpp +++ b/include/ylt/coro_io/client_pool.hpp @@ -292,7 +292,7 @@ class client_pool : public std::enable_shared_from_this< coro_io::detail::client_queue> free_clients_; client_pools_t* pools_manager_ = nullptr; async_simple::Promise idle_timeout_waiter; - std::string_view host_name_; + std::string host_name_; pool_config pool_config_; io_context_pool_t& io_context_pool_; std::atomic collecter_cnt_; diff --git a/src/coro_http/examples/channel.cpp b/src/coro_http/examples/channel.cpp index 7498cd289..5723ea096 100644 --- a/src/coro_http/examples/channel.cpp +++ b/src/coro_http/examples/channel.cpp @@ -64,8 +64,8 @@ Lazy qps_watcher() { } int main() { - std::vector hosts; - hosts.emplace_back("http://www.baidu.com", "http://baidu.com"); + std::vector hosts{"http://baidu.com", + "http://www.baidu.com"}; auto chan = coro_io::channel::create( hosts, coro_io::channel::channel_config{ .pool_config{.max_connection_ = 1000}}); diff --git a/src/coro_rpc/examples/CMakeLists.txt b/src/coro_rpc/examples/CMakeLists.txt index 7d1c4ece8..7dac62dc0 100644 --- a/src/coro_rpc/examples/CMakeLists.txt +++ b/src/coro_rpc/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/tests/coro_rpc) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/examples/coro_rpc) add_subdirectory(base_examples) add_subdirectory(file_transfer) diff --git a/src/coro_rpc/examples/base_examples/channel.cpp b/src/coro_rpc/examples/base_examples/channel.cpp index 87d3cee51..58cff9189 100644 --- a/src/coro_rpc/examples/base_examples/channel.cpp +++ b/src/coro_rpc/examples/base_examples/channel.cpp @@ -86,8 +86,8 @@ Lazy qps_watcher() { } int main() { - auto hosts = std::vector{ - {std::string{"127.0.0.1:8801"}, std::string{"localhost:8801"}}}; + auto hosts = std::vector{ + {"127.0.0.1:8801", "localhost:8801"}}; auto worker_cnt = std::thread::hardware_concurrency() * 20; auto chan = coro_io::channel::create( hosts, coro_io::channel::channel_config{