Skip to content

Commit

Permalink
minor fix for named-pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
youyuanwu committed May 27, 2024
1 parent 65abb58 commit 61e5e48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions include/boost/winasio/named_pipe/named_pipe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class named_pipe : public boost::asio::windows::basic_stream_handle<Executor> {
typedef std::string endpoint_type;
typedef boost::asio::windows::basic_stream_handle<executor_type> parent_type;

named_pipe(executor_type &ex)
named_pipe(const executor_type &ex)
: boost::asio::windows::basic_stream_handle<executor_type>(ex) {}

template <typename ExecutionContext>
Expand All @@ -49,6 +49,9 @@ class named_pipe : public boost::asio::windows::basic_stream_handle<Executor> {
0)
: boost::asio::windows::basic_stream_handle<executor_type>(
context.get_executor()) {}

named_pipe(named_pipe<executor_type> && other)
: boost::asio::windows::basic_stream_handle<executor_type>(std::move(other)) {}

void server_create(boost::system::error_code &ec,
endpoint_type const &endpoint) {
Expand Down Expand Up @@ -127,7 +130,7 @@ class named_pipe : public boost::asio::windows::basic_stream_handle<Executor> {
// 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<executor_type>::is_open()) {
boost::asio::windows::basic_stream_handle<executor_type>::close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 61e5e48

Please sign in to comment.