From 61e5e4837dd626722c5bce574888298e1c1be860 Mon Sep 17 00:00:00 2001 From: Youyuan Wu Date: Mon, 27 May 2024 13:10:36 -0700 Subject: [PATCH] minor fix for named-pipe --- include/boost/winasio/named_pipe/named_pipe.hpp | 7 +++++-- .../boost/winasio/named_pipe/named_pipe_client_details.hpp | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/boost/winasio/named_pipe/named_pipe.hpp b/include/boost/winasio/named_pipe/named_pipe.hpp index 5f67358..0899464 100644 --- a/include/boost/winasio/named_pipe/named_pipe.hpp +++ b/include/boost/winasio/named_pipe/named_pipe.hpp @@ -38,7 +38,7 @@ class named_pipe : public boost::asio::windows::basic_stream_handle { typedef std::string endpoint_type; typedef boost::asio::windows::basic_stream_handle parent_type; - named_pipe(executor_type &ex) + named_pipe(const executor_type &ex) : boost::asio::windows::basic_stream_handle(ex) {} template @@ -49,6 +49,9 @@ class named_pipe : public boost::asio::windows::basic_stream_handle { 0) : boost::asio::windows::basic_stream_handle( context.get_executor()) {} + + named_pipe(named_pipe && other) + : boost::asio::windows::basic_stream_handle(std::move(other)) {} void server_create(boost::system::error_code &ec, endpoint_type const &endpoint) { @@ -127,7 +130,7 @@ class named_pipe : public boost::asio::windows::basic_stream_handle { // used for client to connect BOOST_ASIO_SYNC_OP_VOID connect(const endpoint_type &endpoint, boost::system::error_code &ec, - int timeout_ms = 20000) { + std::uint32_t timeout_ms = 20000) { if (boost::asio::windows::basic_stream_handle::is_open()) { boost::asio::windows::basic_stream_handle::close(); diff --git a/include/boost/winasio/named_pipe/named_pipe_client_details.hpp b/include/boost/winasio/named_pipe/named_pipe_client_details.hpp index b897dbc..d23eaa8 100644 --- a/include/boost/winasio/named_pipe/named_pipe_client_details.hpp +++ b/include/boost/winasio/named_pipe/named_pipe_client_details.hpp @@ -20,7 +20,8 @@ namespace details { // client connect to the namedpipe, // return the ok handle. Caller is responsible for freeing the handle. inline void client_connect(boost::system::error_code &ec, HANDLE &pipe_ret, - std::string const &endpoint, int timeout_ms) { + std::string const &endpoint, + std::uint32_t timeout_ms) { HANDLE hPipe; BOOL fSuccess = FALSE;