]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/asio/detail/win_iocp_socket_service_base.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / asio / detail / win_iocp_socket_service_base.hpp
1 //
2 // detail/win_iocp_socket_service_base.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10
11 #ifndef BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP
12 #define BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP
13
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18 #include <boost/asio/detail/config.hpp>
19
20 #if defined(BOOST_ASIO_HAS_IOCP)
21
22 #include <boost/asio/error.hpp>
23 #include <boost/asio/io_context.hpp>
24 #include <boost/asio/socket_base.hpp>
25 #include <boost/asio/detail/bind_handler.hpp>
26 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
27 #include <boost/asio/detail/fenced_block.hpp>
28 #include <boost/asio/detail/handler_alloc_helpers.hpp>
29 #include <boost/asio/detail/handler_invoke_helpers.hpp>
30 #include <boost/asio/detail/memory.hpp>
31 #include <boost/asio/detail/mutex.hpp>
32 #include <boost/asio/detail/operation.hpp>
33 #include <boost/asio/detail/reactor_op.hpp>
34 #include <boost/asio/detail/select_reactor.hpp>
35 #include <boost/asio/detail/socket_holder.hpp>
36 #include <boost/asio/detail/socket_ops.hpp>
37 #include <boost/asio/detail/socket_types.hpp>
38 #include <boost/asio/detail/win_iocp_io_context.hpp>
39 #include <boost/asio/detail/win_iocp_null_buffers_op.hpp>
40 #include <boost/asio/detail/win_iocp_socket_connect_op.hpp>
41 #include <boost/asio/detail/win_iocp_socket_send_op.hpp>
42 #include <boost/asio/detail/win_iocp_socket_recv_op.hpp>
43 #include <boost/asio/detail/win_iocp_socket_recvmsg_op.hpp>
44 #include <boost/asio/detail/win_iocp_wait_op.hpp>
45
46 #include <boost/asio/detail/push_options.hpp>
47
48 namespace boost {
49 namespace asio {
50 namespace detail {
51
52 class win_iocp_socket_service_base
53 {
54 public:
55 // The implementation type of the socket.
56 struct base_implementation_type
57 {
58 // The native socket representation.
59 socket_type socket_;
60
61 // The current state of the socket.
62 socket_ops::state_type state_;
63
64 // We use a shared pointer as a cancellation token here to work around the
65 // broken Windows support for cancellation. MSDN says that when you call
66 // closesocket any outstanding WSARecv or WSASend operations will complete
67 // with the error ERROR_OPERATION_ABORTED. In practice they complete with
68 // ERROR_NETNAME_DELETED, which means you can't tell the difference between
69 // a local cancellation and the socket being hard-closed by the peer.
70 socket_ops::shared_cancel_token_type cancel_token_;
71
72 // Per-descriptor data used by the reactor.
73 select_reactor::per_descriptor_data reactor_data_;
74
75 #if defined(BOOST_ASIO_ENABLE_CANCELIO)
76 // The ID of the thread from which it is safe to cancel asynchronous
77 // operations. 0 means no asynchronous operations have been started yet.
78 // ~0 means asynchronous operations have been started from more than one
79 // thread, and cancellation is not supported for the socket.
80 DWORD safe_cancellation_thread_id_;
81 #endif // defined(BOOST_ASIO_ENABLE_CANCELIO)
82
83 // Pointers to adjacent socket implementations in linked list.
84 base_implementation_type* next_;
85 base_implementation_type* prev_;
86 };
87
88 // Constructor.
89 BOOST_ASIO_DECL win_iocp_socket_service_base(
90 boost::asio::io_context& io_context);
91
92 // Destroy all user-defined handler objects owned by the service.
93 BOOST_ASIO_DECL void base_shutdown();
94
95 // Construct a new socket implementation.
96 BOOST_ASIO_DECL void construct(base_implementation_type& impl);
97
98 // Move-construct a new socket implementation.
99 BOOST_ASIO_DECL void base_move_construct(base_implementation_type& impl,
100 base_implementation_type& other_impl);
101
102 // Move-assign from another socket implementation.
103 BOOST_ASIO_DECL void base_move_assign(base_implementation_type& impl,
104 win_iocp_socket_service_base& other_service,
105 base_implementation_type& other_impl);
106
107 // Destroy a socket implementation.
108 BOOST_ASIO_DECL void destroy(base_implementation_type& impl);
109
110 // Determine whether the socket is open.
111 bool is_open(const base_implementation_type& impl) const
112 {
113 return impl.socket_ != invalid_socket;
114 }
115
116 // Destroy a socket implementation.
117 BOOST_ASIO_DECL boost::system::error_code close(
118 base_implementation_type& impl, boost::system::error_code& ec);
119
120 // Release ownership of the socket.
121 BOOST_ASIO_DECL socket_type release(
122 base_implementation_type& impl, boost::system::error_code& ec);
123
124 // Cancel all operations associated with the socket.
125 BOOST_ASIO_DECL boost::system::error_code cancel(
126 base_implementation_type& impl, boost::system::error_code& ec);
127
128 // Determine whether the socket is at the out-of-band data mark.
129 bool at_mark(const base_implementation_type& impl,
130 boost::system::error_code& ec) const
131 {
132 return socket_ops::sockatmark(impl.socket_, ec);
133 }
134
135 // Determine the number of bytes available for reading.
136 std::size_t available(const base_implementation_type& impl,
137 boost::system::error_code& ec) const
138 {
139 return socket_ops::available(impl.socket_, ec);
140 }
141
142 // Place the socket into the state where it will listen for new connections.
143 boost::system::error_code listen(base_implementation_type& impl,
144 int backlog, boost::system::error_code& ec)
145 {
146 socket_ops::listen(impl.socket_, backlog, ec);
147 return ec;
148 }
149
150 // Perform an IO control command on the socket.
151 template <typename IO_Control_Command>
152 boost::system::error_code io_control(base_implementation_type& impl,
153 IO_Control_Command& command, boost::system::error_code& ec)
154 {
155 socket_ops::ioctl(impl.socket_, impl.state_, command.name(),
156 static_cast<ioctl_arg_type*>(command.data()), ec);
157 return ec;
158 }
159
160 // Gets the non-blocking mode of the socket.
161 bool non_blocking(const base_implementation_type& impl) const
162 {
163 return (impl.state_ & socket_ops::user_set_non_blocking) != 0;
164 }
165
166 // Sets the non-blocking mode of the socket.
167 boost::system::error_code non_blocking(base_implementation_type& impl,
168 bool mode, boost::system::error_code& ec)
169 {
170 socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec);
171 return ec;
172 }
173
174 // Gets the non-blocking mode of the native socket implementation.
175 bool native_non_blocking(const base_implementation_type& impl) const
176 {
177 return (impl.state_ & socket_ops::internal_non_blocking) != 0;
178 }
179
180 // Sets the non-blocking mode of the native socket implementation.
181 boost::system::error_code native_non_blocking(base_implementation_type& impl,
182 bool mode, boost::system::error_code& ec)
183 {
184 socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec);
185 return ec;
186 }
187
188 // Wait for the socket to become ready to read, ready to write, or to have
189 // pending error conditions.
190 boost::system::error_code wait(base_implementation_type& impl,
191 socket_base::wait_type w, boost::system::error_code& ec)
192 {
193 switch (w)
194 {
195 case socket_base::wait_read:
196 socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
197 break;
198 case socket_base::wait_write:
199 socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
200 break;
201 case socket_base::wait_error:
202 socket_ops::poll_error(impl.socket_, impl.state_, -1, ec);
203 break;
204 default:
205 ec = boost::asio::error::invalid_argument;
206 break;
207 }
208
209 return ec;
210 }
211
212 // Asynchronously wait for the socket to become ready to read, ready to
213 // write, or to have pending error conditions.
214 template <typename Handler>
215 void async_wait(base_implementation_type& impl,
216 socket_base::wait_type w, Handler& handler)
217 {
218 bool is_continuation =
219 boost_asio_handler_cont_helpers::is_continuation(handler);
220
221 // Allocate and construct an operation to wrap the handler.
222 typedef win_iocp_wait_op<Handler> op;
223 typename op::ptr p = { boost::asio::detail::addressof(handler),
224 op::ptr::allocate(handler), 0 };
225 p.p = new (p.v) op(impl.cancel_token_, handler);
226
227 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
228 &impl, impl.socket_, "async_wait"));
229
230 switch (w)
231 {
232 case socket_base::wait_read:
233 start_null_buffers_receive_op(impl, 0, p.p);
234 break;
235 case socket_base::wait_write:
236 start_reactor_op(impl, select_reactor::write_op, p.p);
237 break;
238 case socket_base::wait_error:
239 start_reactor_op(impl, select_reactor::except_op, p.p);
240 break;
241 default:
242 p.p->ec_ = boost::asio::error::invalid_argument;
243 iocp_service_.post_immediate_completion(p.p, is_continuation);
244 break;
245 }
246
247 p.v = p.p = 0;
248 }
249
250 // Send the given data to the peer. Returns the number of bytes sent.
251 template <typename ConstBufferSequence>
252 size_t send(base_implementation_type& impl,
253 const ConstBufferSequence& buffers,
254 socket_base::message_flags flags, boost::system::error_code& ec)
255 {
256 buffer_sequence_adapter<boost::asio::const_buffer,
257 ConstBufferSequence> bufs(buffers);
258
259 return socket_ops::sync_send(impl.socket_, impl.state_,
260 bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec);
261 }
262
263 // Wait until data can be sent without blocking.
264 size_t send(base_implementation_type& impl, const null_buffers&,
265 socket_base::message_flags, boost::system::error_code& ec)
266 {
267 // Wait for socket to become ready.
268 socket_ops::poll_write(impl.socket_, impl.state_, -1, ec);
269
270 return 0;
271 }
272
273 // Start an asynchronous send. The data being sent must be valid for the
274 // lifetime of the asynchronous operation.
275 template <typename ConstBufferSequence, typename Handler>
276 void async_send(base_implementation_type& impl,
277 const ConstBufferSequence& buffers,
278 socket_base::message_flags flags, Handler& handler)
279 {
280 // Allocate and construct an operation to wrap the handler.
281 typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
282 typename op::ptr p = { boost::asio::detail::addressof(handler),
283 op::ptr::allocate(handler), 0 };
284 p.p = new (p.v) op(impl.cancel_token_, buffers, handler);
285
286 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
287 &impl, impl.socket_, "async_send"));
288
289 buffer_sequence_adapter<boost::asio::const_buffer,
290 ConstBufferSequence> bufs(buffers);
291
292 start_send_op(impl, bufs.buffers(), bufs.count(), flags,
293 (impl.state_ & socket_ops::stream_oriented) != 0 && bufs.all_empty(),
294 p.p);
295 p.v = p.p = 0;
296 }
297
298 // Start an asynchronous wait until data can be sent without blocking.
299 template <typename Handler>
300 void async_send(base_implementation_type& impl, const null_buffers&,
301 socket_base::message_flags, Handler& handler)
302 {
303 // Allocate and construct an operation to wrap the handler.
304 typedef win_iocp_null_buffers_op<Handler> op;
305 typename op::ptr p = { boost::asio::detail::addressof(handler),
306 op::ptr::allocate(handler), 0 };
307 p.p = new (p.v) op(impl.cancel_token_, handler);
308
309 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
310 &impl, impl.socket_, "async_send(null_buffers)"));
311
312 start_reactor_op(impl, select_reactor::write_op, p.p);
313 p.v = p.p = 0;
314 }
315
316 // Receive some data from the peer. Returns the number of bytes received.
317 template <typename MutableBufferSequence>
318 size_t receive(base_implementation_type& impl,
319 const MutableBufferSequence& buffers,
320 socket_base::message_flags flags, boost::system::error_code& ec)
321 {
322 buffer_sequence_adapter<boost::asio::mutable_buffer,
323 MutableBufferSequence> bufs(buffers);
324
325 return socket_ops::sync_recv(impl.socket_, impl.state_,
326 bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec);
327 }
328
329 // Wait until data can be received without blocking.
330 size_t receive(base_implementation_type& impl, const null_buffers&,
331 socket_base::message_flags, boost::system::error_code& ec)
332 {
333 // Wait for socket to become ready.
334 socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
335
336 return 0;
337 }
338
339 // Start an asynchronous receive. The buffer for the data being received
340 // must be valid for the lifetime of the asynchronous operation.
341 template <typename MutableBufferSequence, typename Handler>
342 void async_receive(base_implementation_type& impl,
343 const MutableBufferSequence& buffers,
344 socket_base::message_flags flags, Handler& handler)
345 {
346 // Allocate and construct an operation to wrap the handler.
347 typedef win_iocp_socket_recv_op<MutableBufferSequence, Handler> op;
348 typename op::ptr p = { boost::asio::detail::addressof(handler),
349 op::ptr::allocate(handler), 0 };
350 p.p = new (p.v) op(impl.state_, impl.cancel_token_, buffers, handler);
351
352 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
353 &impl, impl.socket_, "async_receive"));
354
355 buffer_sequence_adapter<boost::asio::mutable_buffer,
356 MutableBufferSequence> bufs(buffers);
357
358 start_receive_op(impl, bufs.buffers(), bufs.count(), flags,
359 (impl.state_ & socket_ops::stream_oriented) != 0 && bufs.all_empty(),
360 p.p);
361 p.v = p.p = 0;
362 }
363
364 // Wait until data can be received without blocking.
365 template <typename Handler>
366 void async_receive(base_implementation_type& impl, const null_buffers&,
367 socket_base::message_flags flags, Handler& handler)
368 {
369 // Allocate and construct an operation to wrap the handler.
370 typedef win_iocp_null_buffers_op<Handler> op;
371 typename op::ptr p = { boost::asio::detail::addressof(handler),
372 op::ptr::allocate(handler), 0 };
373 p.p = new (p.v) op(impl.cancel_token_, handler);
374
375 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
376 &impl, impl.socket_, "async_receive(null_buffers)"));
377
378 start_null_buffers_receive_op(impl, flags, p.p);
379 p.v = p.p = 0;
380 }
381
382 // Receive some data with associated flags. Returns the number of bytes
383 // received.
384 template <typename MutableBufferSequence>
385 size_t receive_with_flags(base_implementation_type& impl,
386 const MutableBufferSequence& buffers,
387 socket_base::message_flags in_flags,
388 socket_base::message_flags& out_flags, boost::system::error_code& ec)
389 {
390 buffer_sequence_adapter<boost::asio::mutable_buffer,
391 MutableBufferSequence> bufs(buffers);
392
393 return socket_ops::sync_recvmsg(impl.socket_, impl.state_,
394 bufs.buffers(), bufs.count(), in_flags, out_flags, ec);
395 }
396
397 // Wait until data can be received without blocking.
398 size_t receive_with_flags(base_implementation_type& impl,
399 const null_buffers&, socket_base::message_flags,
400 socket_base::message_flags& out_flags, boost::system::error_code& ec)
401 {
402 // Wait for socket to become ready.
403 socket_ops::poll_read(impl.socket_, impl.state_, -1, ec);
404
405 // Clear out_flags, since we cannot give it any other sensible value when
406 // performing a null_buffers operation.
407 out_flags = 0;
408
409 return 0;
410 }
411
412 // Start an asynchronous receive. The buffer for the data being received
413 // must be valid for the lifetime of the asynchronous operation.
414 template <typename MutableBufferSequence, typename Handler>
415 void async_receive_with_flags(base_implementation_type& impl,
416 const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
417 socket_base::message_flags& out_flags, Handler& handler)
418 {
419 // Allocate and construct an operation to wrap the handler.
420 typedef win_iocp_socket_recvmsg_op<MutableBufferSequence, Handler> op;
421 typename op::ptr p = { boost::asio::detail::addressof(handler),
422 op::ptr::allocate(handler), 0 };
423 p.p = new (p.v) op(impl.cancel_token_, buffers, out_flags, handler);
424
425 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
426 &impl, impl.socket_, "async_receive_with_flags"));
427
428 buffer_sequence_adapter<boost::asio::mutable_buffer,
429 MutableBufferSequence> bufs(buffers);
430
431 start_receive_op(impl, bufs.buffers(), bufs.count(), in_flags, false, p.p);
432 p.v = p.p = 0;
433 }
434
435 // Wait until data can be received without blocking.
436 template <typename Handler>
437 void async_receive_with_flags(base_implementation_type& impl,
438 const null_buffers&, socket_base::message_flags in_flags,
439 socket_base::message_flags& out_flags, Handler& handler)
440 {
441 // Allocate and construct an operation to wrap the handler.
442 typedef win_iocp_null_buffers_op<Handler> op;
443 typename op::ptr p = { boost::asio::detail::addressof(handler),
444 op::ptr::allocate(handler), 0 };
445 p.p = new (p.v) op(impl.cancel_token_, handler);
446
447 BOOST_ASIO_HANDLER_CREATION((io_context_, *p.p, "socket",
448 &impl, impl.socket_, "async_receive_with_flags(null_buffers)"));
449
450 // Reset out_flags since it can be given no sensible value at this time.
451 out_flags = 0;
452
453 start_null_buffers_receive_op(impl, in_flags, p.p);
454 p.v = p.p = 0;
455 }
456
457 // Helper function to restart an asynchronous accept operation.
458 BOOST_ASIO_DECL void restart_accept_op(socket_type s,
459 socket_holder& new_socket, int family, int type, int protocol,
460 void* output_buffer, DWORD address_length, operation* op);
461
462 protected:
463 // Open a new socket implementation.
464 BOOST_ASIO_DECL boost::system::error_code do_open(
465 base_implementation_type& impl, int family, int type,
466 int protocol, boost::system::error_code& ec);
467
468 // Assign a native socket to a socket implementation.
469 BOOST_ASIO_DECL boost::system::error_code do_assign(
470 base_implementation_type& impl, int type,
471 socket_type native_socket, boost::system::error_code& ec);
472
473 // Helper function to start an asynchronous send operation.
474 BOOST_ASIO_DECL void start_send_op(base_implementation_type& impl,
475 WSABUF* buffers, std::size_t buffer_count,
476 socket_base::message_flags flags, bool noop, operation* op);
477
478 // Helper function to start an asynchronous send_to operation.
479 BOOST_ASIO_DECL void start_send_to_op(base_implementation_type& impl,
480 WSABUF* buffers, std::size_t buffer_count,
481 const socket_addr_type* addr, int addrlen,
482 socket_base::message_flags flags, operation* op);
483
484 // Helper function to start an asynchronous receive operation.
485 BOOST_ASIO_DECL void start_receive_op(base_implementation_type& impl,
486 WSABUF* buffers, std::size_t buffer_count,
487 socket_base::message_flags flags, bool noop, operation* op);
488
489 // Helper function to start an asynchronous null_buffers receive operation.
490 BOOST_ASIO_DECL void start_null_buffers_receive_op(
491 base_implementation_type& impl,
492 socket_base::message_flags flags, reactor_op* op);
493
494 // Helper function to start an asynchronous receive_from operation.
495 BOOST_ASIO_DECL void start_receive_from_op(base_implementation_type& impl,
496 WSABUF* buffers, std::size_t buffer_count, socket_addr_type* addr,
497 socket_base::message_flags flags, int* addrlen, operation* op);
498
499 // Helper function to start an asynchronous accept operation.
500 BOOST_ASIO_DECL void start_accept_op(base_implementation_type& impl,
501 bool peer_is_open, socket_holder& new_socket, int family, int type,
502 int protocol, void* output_buffer, DWORD address_length, operation* op);
503
504 // Start an asynchronous read or write operation using the reactor.
505 BOOST_ASIO_DECL void start_reactor_op(base_implementation_type& impl,
506 int op_type, reactor_op* op);
507
508 // Start the asynchronous connect operation using the reactor.
509 BOOST_ASIO_DECL void start_connect_op(base_implementation_type& impl,
510 int family, int type, const socket_addr_type* remote_addr,
511 std::size_t remote_addrlen, win_iocp_socket_connect_op_base* op);
512
513 // Helper function to close a socket when the associated object is being
514 // destroyed.
515 BOOST_ASIO_DECL void close_for_destruction(base_implementation_type& impl);
516
517 // Update the ID of the thread from which cancellation is safe.
518 BOOST_ASIO_DECL void update_cancellation_thread_id(
519 base_implementation_type& impl);
520
521 // Helper function to get the reactor. If no reactor has been created yet, a
522 // new one is obtained from the io_context and a pointer to it is cached in
523 // this service.
524 BOOST_ASIO_DECL select_reactor& get_reactor();
525
526 // The type of a ConnectEx function pointer, as old SDKs may not provide it.
527 typedef BOOL (PASCAL *connect_ex_fn)(SOCKET,
528 const socket_addr_type*, int, void*, DWORD, DWORD*, OVERLAPPED*);
529
530 // Helper function to get the ConnectEx pointer. If no ConnectEx pointer has
531 // been obtained yet, one is obtained using WSAIoctl and the pointer is
532 // cached. Returns a null pointer if ConnectEx is not available.
533 BOOST_ASIO_DECL connect_ex_fn get_connect_ex(
534 base_implementation_type& impl, int type);
535
536 // The type of a NtSetInformationFile function pointer.
537 typedef LONG (NTAPI *nt_set_info_fn)(HANDLE, ULONG_PTR*, void*, ULONG, ULONG);
538
539 // Helper function to get the NtSetInformationFile function pointer. If no
540 // NtSetInformationFile pointer has been obtained yet, one is obtained using
541 // GetProcAddress and the pointer is cached. Returns a null pointer if
542 // NtSetInformationFile is not available.
543 BOOST_ASIO_DECL nt_set_info_fn get_nt_set_info();
544
545 // Helper function to emulate InterlockedCompareExchangePointer functionality
546 // for:
547 // - very old Platform SDKs; and
548 // - platform SDKs where MSVC's /Wp64 option causes spurious warnings.
549 BOOST_ASIO_DECL void* interlocked_compare_exchange_pointer(
550 void** dest, void* exch, void* cmp);
551
552 // Helper function to emulate InterlockedExchangePointer functionality for:
553 // - very old Platform SDKs; and
554 // - platform SDKs where MSVC's /Wp64 option causes spurious warnings.
555 BOOST_ASIO_DECL void* interlocked_exchange_pointer(void** dest, void* val);
556
557 // The io_context used to obtain the reactor, if required.
558 boost::asio::io_context& io_context_;
559
560 // The IOCP service used for running asynchronous operations and dispatching
561 // handlers.
562 win_iocp_io_context& iocp_service_;
563
564 // The reactor used for performing connect operations. This object is created
565 // only if needed.
566 select_reactor* reactor_;
567
568 // Pointer to ConnectEx implementation.
569 void* connect_ex_;
570
571 // Pointer to NtSetInformationFile implementation.
572 void* nt_set_info_;
573
574 // Mutex to protect access to the linked list of implementations.
575 boost::asio::detail::mutex mutex_;
576
577 // The head of a linked list of all implementations.
578 base_implementation_type* impl_list_;
579 };
580
581 } // namespace detail
582 } // namespace asio
583 } // namespace boost
584
585 #include <boost/asio/detail/pop_options.hpp>
586
587 #if defined(BOOST_ASIO_HEADER_ONLY)
588 # include <boost/asio/detail/impl/win_iocp_socket_service_base.ipp>
589 #endif // defined(BOOST_ASIO_HEADER_ONLY)
590
591 #endif // defined(BOOST_ASIO_HAS_IOCP)
592
593 #endif // BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_SERVICE_BASE_HPP