forked from boostorg/beast
Harmonize concepts and identifiers with net-ts (API Change):
fix #321 This synchronizes identifier names and some implementation details with the Networking-TS document and reference implementation. The following interfaces have changed: * async_completion * is_buffer_sequence (removed) * is_const_buffer_sequence (was is_ConstBufferSequence) * is_dynamic_buffer (was is_DynamicBuffer) * is_mutable_buffer_sequence (was is_MutableBufferSequence) * async_result (new) * BEAST_HANDLER_TYPE macro (new) * BEAST_INITFN_RESULT_TYPE macro (new) Filename changes: * async_result.hpp (was async_completion.hpp)
This commit is contained in:
1 parent
46097c7dab
commit
d9562ff525
44 files changed
+616
-615
No files matched your search
@@ -360,7 +360,7 @@ accept(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -379,7 +379,7 @@ accept_ex(ConstBufferSequence const& buffers,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
@@ -399,7 +399,7 @@ accept(ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
reset();
|
||||
@@ -421,10 +421,10 @@ accept_ex(ConstBufferSequence const& buffers,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
reset();
|
||||
@@ -506,7 +506,7 @@ accept(http::header<true, Fields> const& req,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -526,7 +526,7 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
@@ -547,7 +547,7 @@ accept(http::header<true, Fields> const& req,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
reset();
|
||||
@@ -571,7 +571,7 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
@@ -590,26 +590,26 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
|
||||
template<class NextLayer>
|
||||
template<class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept(AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
accept_op<decltype(&default_decorate_res),
|
||||
decltype(completion.handler)>{completion.handler,
|
||||
*this, &default_decorate_res};
|
||||
return completion.result.get();
|
||||
BEAST_HANDLER_TYPE(AcceptHandler, void(error_code))>{
|
||||
init.completion_handler, *this, &default_decorate_res};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class ResponseDecorator, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept_ex(ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler)
|
||||
@@ -619,41 +619,42 @@ async_accept_ex(ResponseDecorator const& decorator,
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
ResponseDecorator>::value,
|
||||
"ResponseDecorator requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
accept_op<ResponseDecorator, decltype(completion.handler)>{
|
||||
completion.handler, *this, decorator};
|
||||
return completion.result.get();
|
||||
accept_op<ResponseDecorator, BEAST_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{
|
||||
init.completion_handler, *this, decorator};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class ConstBufferSequence, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept(ConstBufferSequence const& buffers,
|
||||
AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
accept_op<decltype(&default_decorate_res),
|
||||
decltype(completion.handler)>{completion.handler,
|
||||
*this, buffers, &default_decorate_res};
|
||||
return completion.result.get();
|
||||
BEAST_HANDLER_TYPE(AcceptHandler, void(error_code))>{
|
||||
init.completion_handler, *this, buffers, &default_decorate_res};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class ConstBufferSequence,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept_ex(ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
@@ -661,45 +662,47 @@ async_accept_ex(ConstBufferSequence const& buffers,
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
ResponseDecorator>::value,
|
||||
"ResponseDecorator requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
accept_op<ResponseDecorator, decltype(completion.handler)>{
|
||||
completion.handler, *this, buffers, decorator};
|
||||
return completion.result.get();
|
||||
accept_op<ResponseDecorator, BEAST_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{
|
||||
init.completion_handler, *this, buffers, decorator};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept(http::header<true, Fields> const& req,
|
||||
AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
response_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, req,
|
||||
&default_decorate_res, beast_asio_helpers::
|
||||
is_continuation(completion.handler)};
|
||||
return completion.result.get();
|
||||
response_op<BEAST_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{init.completion_handler,
|
||||
*this, req, &default_decorate_res,
|
||||
beast_asio_helpers::is_continuation(
|
||||
init.completion_handler)};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept_ex(http::header<true, Fields> const& req,
|
||||
ResponseDecorator const& decorator, AcceptHandler&& handler)
|
||||
@@ -709,21 +712,22 @@ async_accept_ex(http::header<true, Fields> const& req,
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
ResponseDecorator>::value,
|
||||
"ResponseDecorator requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
response_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, req, decorator,
|
||||
beast_asio_helpers::is_continuation(
|
||||
completion.handler)};
|
||||
return completion.result.get();
|
||||
response_op<BEAST_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{
|
||||
init.completion_handler, *this, req, decorator,
|
||||
beast_asio_helpers::is_continuation(
|
||||
init.completion_handler)};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields,
|
||||
class ConstBufferSequence, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
@@ -731,24 +735,25 @@ async_accept(http::header<true, Fields> const& req,
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
response_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, req, buffers,
|
||||
&default_decorate_res, beast_asio_helpers::
|
||||
is_continuation(completion.handler)};
|
||||
return completion.result.get();
|
||||
response_op<BEAST_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{
|
||||
init.completion_handler, *this, req, buffers,
|
||||
&default_decorate_res, beast_asio_helpers::
|
||||
is_continuation(init.completion_handler)};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class ConstBufferSequence,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
typename async_completion<AcceptHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
AcceptHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
@@ -757,20 +762,21 @@ async_accept_ex(http::header<true, Fields> const& req,
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
static_assert(is_ConstBufferSequence<
|
||||
static_assert(is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_ResponseDecorator<
|
||||
ResponseDecorator>::value,
|
||||
"ResponseDecorator requirements not met");
|
||||
beast::async_completion<AcceptHandler,
|
||||
void(error_code)> completion{handler};
|
||||
async_completion<AcceptHandler,
|
||||
void(error_code)> init{handler};
|
||||
reset();
|
||||
response_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, req, buffers, decorator,
|
||||
beast_asio_helpers::is_continuation(
|
||||
completion.handler)};
|
||||
return completion.result.get();
|
||||
response_op<BEAST_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{init.completion_handler,
|
||||
*this, req, buffers, decorator,
|
||||
beast_asio_helpers::is_continuation(
|
||||
init.completion_handler)};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
} // websocket
|
||||
|
||||
@@ -197,19 +197,19 @@ upcall:
|
||||
|
||||
template<class NextLayer>
|
||||
template<class CloseHandler>
|
||||
typename async_completion<
|
||||
CloseHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
CloseHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_close(close_reason const& cr, CloseHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
beast::async_completion<
|
||||
CloseHandler, void(error_code)
|
||||
> completion{handler};
|
||||
close_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, cr};
|
||||
return completion.result.get();
|
||||
async_completion<CloseHandler,
|
||||
void(error_code)> init{handler};
|
||||
close_op<BEAST_HANDLER_TYPE(
|
||||
CloseHandler, void(error_code))>{
|
||||
init.completion_handler, *this, cr};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -160,8 +160,8 @@ operator()(error_code ec, bool again)
|
||||
|
||||
template<class NextLayer>
|
||||
template<class HandshakeHandler>
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
HandshakeHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_handshake(string_view const& host,
|
||||
string_view const& target,
|
||||
@@ -169,18 +169,19 @@ async_handshake(string_view const& host,
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
beast::async_completion<HandshakeHandler,
|
||||
void(error_code)> completion{handler};
|
||||
handshake_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, nullptr,
|
||||
host, target, &default_decorate_req};
|
||||
return completion.result.get();
|
||||
async_completion<HandshakeHandler,
|
||||
void(error_code)> init{handler};
|
||||
handshake_op<BEAST_HANDLER_TYPE(
|
||||
HandshakeHandler, void(error_code))>{
|
||||
init.completion_handler, *this, nullptr, host,
|
||||
target, &default_decorate_req};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class HandshakeHandler>
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
HandshakeHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_handshake(response_type& res,
|
||||
string_view const& host,
|
||||
@@ -189,18 +190,19 @@ async_handshake(response_type& res,
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
beast::async_completion<HandshakeHandler,
|
||||
void(error_code)> completion{handler};
|
||||
handshake_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, &res,
|
||||
host, target, &default_decorate_req};
|
||||
return completion.result.get();
|
||||
async_completion<HandshakeHandler,
|
||||
void(error_code)> init{handler};
|
||||
handshake_op<BEAST_HANDLER_TYPE(
|
||||
HandshakeHandler, void(error_code))>{
|
||||
init.completion_handler, *this, &res, host,
|
||||
target, &default_decorate_req};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class RequestDecorator, class HandshakeHandler>
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
HandshakeHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
@@ -212,18 +214,19 @@ async_handshake_ex(string_view const& host,
|
||||
static_assert(detail::is_RequestDecorator<
|
||||
RequestDecorator>::value,
|
||||
"RequestDecorator requirements not met");
|
||||
beast::async_completion<HandshakeHandler,
|
||||
void(error_code)> completion{handler};
|
||||
handshake_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, nullptr,
|
||||
host, target, decorator};
|
||||
return completion.result.get();
|
||||
async_completion<HandshakeHandler,
|
||||
void(error_code)> init{handler};
|
||||
handshake_op<BEAST_HANDLER_TYPE(
|
||||
HandshakeHandler, void(error_code))>{
|
||||
init.completion_handler, *this, nullptr, host,
|
||||
target, decorator};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class RequestDecorator, class HandshakeHandler>
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
HandshakeHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_handshake_ex(response_type& res,
|
||||
string_view const& host,
|
||||
@@ -236,12 +239,13 @@ async_handshake_ex(response_type& res,
|
||||
static_assert(detail::is_RequestDecorator<
|
||||
RequestDecorator>::value,
|
||||
"RequestDecorator requirements not met");
|
||||
beast::async_completion<HandshakeHandler,
|
||||
void(error_code)> completion{handler};
|
||||
handshake_op<decltype(completion.handler)>{
|
||||
completion.handler, *this, &res,
|
||||
host, target, decorator};
|
||||
return completion.result.get();
|
||||
async_completion<HandshakeHandler,
|
||||
void(error_code)> init{handler};
|
||||
handshake_op<BEAST_HANDLER_TYPE(
|
||||
HandshakeHandler, void(error_code))>{
|
||||
init.completion_handler, *this, &res, host,
|
||||
target, decorator};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -195,38 +195,36 @@ upcall:
|
||||
|
||||
template<class NextLayer>
|
||||
template<class WriteHandler>
|
||||
typename async_completion<
|
||||
WriteHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
WriteHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_ping(ping_data const& payload, WriteHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
beast::async_completion<
|
||||
WriteHandler, void(error_code)
|
||||
> completion{handler};
|
||||
ping_op<decltype(completion.handler)>{
|
||||
completion.handler, *this,
|
||||
opcode::ping, payload};
|
||||
return completion.result.get();
|
||||
async_completion<WriteHandler,
|
||||
void(error_code)> init{handler};
|
||||
ping_op<BEAST_HANDLER_TYPE(
|
||||
WriteHandler, void(error_code))>{
|
||||
init.completion_handler, *this, opcode::ping, payload};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class WriteHandler>
|
||||
typename async_completion<
|
||||
WriteHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
WriteHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_pong(ping_data const& payload, WriteHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
beast::async_completion<
|
||||
WriteHandler, void(error_code)
|
||||
> completion{handler};
|
||||
ping_op<decltype(completion.handler)>{
|
||||
completion.handler, *this,
|
||||
opcode::pong, payload};
|
||||
return completion.result.get();
|
||||
async_completion<WriteHandler,
|
||||
void(error_code)> init{handler};
|
||||
ping_op<BEAST_HANDLER_TYPE(
|
||||
WriteHandler, void(error_code))>{
|
||||
init.completion_handler, *this, opcode::pong, payload};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
|
||||
@@ -686,21 +686,22 @@ upcall:
|
||||
|
||||
template<class NextLayer>
|
||||
template<class DynamicBuffer, class ReadHandler>
|
||||
typename async_completion<
|
||||
ReadHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
ReadHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_read_frame(frame_info& fi,
|
||||
DynamicBuffer& dynabuf, ReadHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
static_assert(beast::is_DynamicBuffer<DynamicBuffer>::value,
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
beast::async_completion<
|
||||
ReadHandler, void(error_code)> completion{handler};
|
||||
read_frame_op<DynamicBuffer, decltype(completion.handler)>{
|
||||
completion.handler, *this, fi, dynabuf};
|
||||
return completion.result.get();
|
||||
async_completion<ReadHandler,
|
||||
void(error_code)> init{handler};
|
||||
read_frame_op<DynamicBuffer, BEAST_HANDLER_TYPE(
|
||||
ReadHandler, void(error_code))>{init.completion_handler,
|
||||
*this, fi, dynabuf};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -711,7 +712,7 @@ read_frame(frame_info& fi, DynamicBuffer& dynabuf)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_DynamicBuffer<DynamicBuffer>::value,
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
read_frame(fi, dynabuf, ec);
|
||||
@@ -727,7 +728,7 @@ read_frame(frame_info& fi, DynamicBuffer& dynabuf, error_code& ec)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_DynamicBuffer<DynamicBuffer>::value,
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
using beast::detail::clamp;
|
||||
using boost::asio::buffer;
|
||||
@@ -1097,22 +1098,22 @@ upcall:
|
||||
|
||||
template<class NextLayer>
|
||||
template<class DynamicBuffer, class ReadHandler>
|
||||
typename async_completion<
|
||||
ReadHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
ReadHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_read(opcode& op,
|
||||
DynamicBuffer& dynabuf, ReadHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
static_assert(beast::is_DynamicBuffer<DynamicBuffer>::value,
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
beast::async_completion<
|
||||
ReadHandler, void(error_code)
|
||||
> completion{handler};
|
||||
read_op<DynamicBuffer, decltype(completion.handler)>{
|
||||
completion.handler, *this, op, dynabuf};
|
||||
return completion.result.get();
|
||||
async_completion<ReadHandler,
|
||||
void(error_code)> init{handler};
|
||||
read_op<DynamicBuffer, BEAST_HANDLER_TYPE(
|
||||
ReadHandler, void(error_code))>{init.completion_handler,
|
||||
*this, op, dynabuf};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -1123,7 +1124,7 @@ read(opcode& op, DynamicBuffer& dynabuf)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_DynamicBuffer<DynamicBuffer>::value,
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
read(op, dynabuf, ec);
|
||||
@@ -1139,7 +1140,7 @@ read(opcode& op, DynamicBuffer& dynabuf, error_code& ec)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_DynamicBuffer<DynamicBuffer>::value,
|
||||
static_assert(beast::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
frame_info fi;
|
||||
for(;;)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef BEAST_WEBSOCKET_IMPL_SSL_IPP_INCLUDED
|
||||
#define BEAST_WEBSOCKET_IMPL_SSL_IPP_INCLUDED
|
||||
|
||||
#include <beast/core/async_completion.hpp>
|
||||
#include <beast/core/async_result.hpp>
|
||||
#include <beast/core/handler_helpers.hpp>
|
||||
#include <beast/core/handler_concepts.hpp>
|
||||
#include <beast/core/handler_ptr.hpp>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef BEAST_WEBSOCKET_IMPL_TEARDOWN_IPP
|
||||
#define BEAST_WEBSOCKET_IMPL_TEARDOWN_IPP
|
||||
|
||||
#include <beast/core/async_completion.hpp>
|
||||
#include <beast/core/async_result.hpp>
|
||||
#include <beast/core/handler_concepts.hpp>
|
||||
#include <beast/core/handler_helpers.hpp>
|
||||
#include <beast/core/handler_ptr.hpp>
|
||||
|
||||
@@ -545,24 +545,23 @@ upcall:
|
||||
|
||||
template<class NextLayer>
|
||||
template<class ConstBufferSequence, class WriteHandler>
|
||||
typename async_completion<
|
||||
WriteHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
WriteHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_write_frame(bool fin,
|
||||
ConstBufferSequence const& bs, WriteHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(beast::is_ConstBufferSequence<
|
||||
static_assert(beast::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
beast::async_completion<
|
||||
WriteHandler, void(error_code)
|
||||
> completion{handler};
|
||||
write_frame_op<ConstBufferSequence, decltype(
|
||||
completion.handler)>{completion.handler,
|
||||
async_completion<WriteHandler,
|
||||
void(error_code)> init{handler};
|
||||
write_frame_op<ConstBufferSequence, BEAST_HANDLER_TYPE(
|
||||
WriteHandler, void(error_code))>{init.completion_handler,
|
||||
*this, fin, bs};
|
||||
return completion.result.get();
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -573,7 +572,7 @@ write_frame(bool fin, ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_ConstBufferSequence<
|
||||
static_assert(beast::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -591,7 +590,7 @@ write_frame(bool fin,
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_ConstBufferSequence<
|
||||
static_assert(beast::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using beast::detail::clamp;
|
||||
@@ -896,21 +895,22 @@ operator()(error_code ec, bool again)
|
||||
|
||||
template<class NextLayer>
|
||||
template<class ConstBufferSequence, class WriteHandler>
|
||||
typename async_completion<
|
||||
WriteHandler, void(error_code)>::result_type
|
||||
BEAST_INITFN_RESULT_TYPE(
|
||||
WriteHandler, void(error_code))
|
||||
stream<NextLayer>::
|
||||
async_write(ConstBufferSequence const& bs, WriteHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(beast::is_ConstBufferSequence<
|
||||
static_assert(beast::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
beast::async_completion<
|
||||
WriteHandler, void(error_code)> completion{handler};
|
||||
write_op<ConstBufferSequence, decltype(completion.handler)>{
|
||||
completion.handler, *this, bs};
|
||||
return completion.result.get();
|
||||
async_completion<WriteHandler,
|
||||
void(error_code)> init{handler};
|
||||
write_op<ConstBufferSequence, BEAST_HANDLER_TYPE(
|
||||
WriteHandler, void(error_code))>{
|
||||
init.completion_handler, *this, bs};
|
||||
return init.result.get();
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
@@ -921,7 +921,7 @@ write(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_ConstBufferSequence<
|
||||
static_assert(beast::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -938,7 +938,7 @@ write(ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(beast::is_ConstBufferSequence<
|
||||
static_assert(beast::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
write_frame(true, buffers, ec);
|
||||
|
||||
Reference in new issue
Block a user