Async init-fns use the executor's default token

This commit is contained in:
Vinnie Falco
2019-10-31 05:47:05 -07:00
parent 2ccb110dc9
commit 7cc8759261
11 changed files with 265 additions and 87 deletions
+13 -4
View File
@@ -243,11 +243,15 @@ public:
}
/// Read some data from the stream asynchronously
template <class MutableBufferSequence, class ReadHandler>
template<
class MutableBufferSequence,
class ReadHandler =
net::default_completion_token_t<executor_type>>
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
async_read_some(
MutableBufferSequence const& buffers,
ReadHandler&& handler)
ReadHandler&& handler =
net::default_completion_token_t<executor_type>{})
{
return net::async_initiate<
ReadHandler,
@@ -259,11 +263,16 @@ public:
}
/// Write some data to the stream asynchronously
template <class ConstBufferSequence, class WriteHandler>
template<
class ConstBufferSequence,
class WriteHandler =
net::default_completion_token_t<executor_type>>
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
async_write_some(
ConstBufferSequence const& buffers,
WriteHandler&& handler)
WriteHandler&& handler =
net::default_completion_token_t<
executor_type>{})
{
return net::async_initiate<
WriteHandler,