summaryrefslogtreecommitdiff
path: root/boost/asio/detail/winrt_ssocket_service.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/detail/winrt_ssocket_service.hpp')
-rw-r--r--boost/asio/detail/winrt_ssocket_service.hpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/boost/asio/detail/winrt_ssocket_service.hpp b/boost/asio/detail/winrt_ssocket_service.hpp
index b9b1910e78..a1e15db545 100644
--- a/boost/asio/detail/winrt_ssocket_service.hpp
+++ b/boost/asio/detail/winrt_ssocket_service.hpp
@@ -20,8 +20,8 @@
#if defined(BOOST_ASIO_WINDOWS_RUNTIME)
#include <boost/asio/error.hpp>
-#include <boost/asio/io_service.hpp>
-#include <boost/asio/detail/addressof.hpp>
+#include <boost/asio/io_context.hpp>
+#include <boost/asio/detail/memory.hpp>
#include <boost/asio/detail/winrt_socket_connect_op.hpp>
#include <boost/asio/detail/winrt_ssocket_service_base.hpp>
#include <boost/asio/detail/winrt_utils.hpp>
@@ -34,6 +34,7 @@ namespace detail {
template <typename Protocol>
class winrt_ssocket_service :
+ public service_base<winrt_ssocket_service<Protocol> >,
public winrt_ssocket_service_base
{
public:
@@ -61,11 +62,18 @@ public:
};
// Constructor.
- winrt_ssocket_service(boost::asio::io_service& io_service)
- : winrt_ssocket_service_base(io_service)
+ winrt_ssocket_service(boost::asio::io_context& io_context)
+ : service_base<winrt_ssocket_service<Protocol> >(io_context),
+ winrt_ssocket_service_base(io_context)
{
}
+ // Destroy all user-defined handler objects owned by the service.
+ void shutdown()
+ {
+ this->base_shutdown();
+ }
+
// Move-construct a new socket implementation.
void move_construct(implementation_type& impl,
implementation_type& other_impl)
@@ -213,11 +221,11 @@ public:
// Allocate and construct an operation to wrap the handler.
typedef winrt_socket_connect_op<Handler> op;
typename op::ptr p = { boost::asio::detail::addressof(handler),
- boost_asio_handler_alloc_helpers::allocate(
- sizeof(op), handler), 0 };
+ op::ptr::allocate(handler), 0 };
p.p = new (p.v) op(handler);
- BOOST_ASIO_HANDLER_CREATION((p.p, "socket", &impl, "async_connect"));
+ BOOST_ASIO_HANDLER_CREATION((io_context_.context(),
+ *p.p, "socket", &impl, 0, "async_connect"));
start_connect_op(impl, peer_endpoint.data(), p.p, is_continuation);
p.v = p.p = 0;