]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/asio/doc/overview/windows.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / asio / doc / overview / windows.qbk
CommitLineData
7c673cae
FG
1[/
2 / Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
3 /
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 /]
7
8[section:windows Windows-Specific Functionality]
9
10[link boost_asio.overview.windows.stream_handle Stream-Oriented HANDLEs]
11
12[link boost_asio.overview.windows.random_access_handle Random-Access HANDLEs]
13
14[link boost_asio.overview.windows.object_handle Object HANDLEs]
15
16[section:stream_handle Stream-Oriented HANDLEs]
17
18Boost.Asio contains classes to allow asynchronous read and write operations to be
19performed on Windows `HANDLE`s, such as named pipes.
20
21For example, to perform asynchronous operations on a named pipe, the following
22object may be created:
23
24 HANDLE handle = ::CreateFile(...);
25 windows::stream_handle pipe(my_io_service, handle);
26
27These are then used as synchronous or asynchronous read and write streams. This
28means the objects can be used with any of the [link boost_asio.reference.read
29read()], [link boost_asio.reference.async_read async_read()], [link
30boost_asio.reference.write write()], [link boost_asio.reference.async_write
31async_write()], [link boost_asio.reference.read_until read_until()] or [link
32boost_asio.reference.async_read_until async_read_until()] free functions.
33
34The kernel object referred to by the `HANDLE` must support use with I/O
35completion ports (which means that named pipes are supported, but anonymous
36pipes and console streams are not).
37
38[heading See Also]
39
40[link boost_asio.reference.windows__stream_handle windows::stream_handle],
41[link boost_asio.reference.windows__basic_stream_handle windows::basic_stream_handle],
42[link boost_asio.reference.windows__stream_handle_service windows::stream_handle_service].
43
44[heading Notes]
45
46Windows stream `HANDLE`s are only available at compile time when targeting
47Windows and only when the I/O completion port backend is used (which is the
48default). A program may test for the macro `BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE` to
49determine whether they are supported.
50
51[endsect]
52
53[/-----------------------------------------------------------------------------]
54
55[section:random_access_handle Random-Access HANDLEs]
56
57Boost.Asio provides Windows-specific classes that permit asynchronous read and write
58operations to be performed on HANDLEs that refer to regular files.
59
60For example, to perform asynchronous operations on a file the following object
61may be created:
62
63 HANDLE handle = ::CreateFile(...);
64 windows::random_access_handle file(my_io_service, handle);
65
66Data may be read from or written to the handle using one of the
67`read_some_at()`, `async_read_some_at()`, `write_some_at()` or
68`async_write_some_at()` member functions. However, like the equivalent
69functions (`read_some()`, etc.) on streams, these functions are only required
70to transfer one or more bytes in a single operation. Therefore free functions
71called [link boost_asio.reference.read_at read_at()], [link
72boost_asio.reference.async_read_at async_read_at()], [link boost_asio.reference.write_at
73write_at()] and [link boost_asio.reference.async_write_at async_write_at()] have been
74created to repeatedly call the corresponding [^[**]_some_at()] function until
75all data has been transferred.
76
77[heading See Also]
78
79[link boost_asio.reference.windows__random_access_handle windows::random_access_handle],
80[link boost_asio.reference.windows__basic_random_access_handle windows::basic_random_access_handle],
81[link boost_asio.reference.windows__random_access_handle_service windows::random_access_handle_service].
82
83[heading Notes]
84
85Windows random-access `HANDLE`s are only available at compile time when
86targeting Windows and only when the I/O completion port backend is used (which
87is the default). A program may test for the macro
88`BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE` to determine whether they are
89supported.
90
91[endsect]
92
93[/-----------------------------------------------------------------------------]
94
95[section:object_handle Object HANDLEs]
96
97Boost.Asio provides Windows-specific classes that permit asynchronous wait operations
98to be performed on HANDLEs to kernel objects of the following types:
99
100* Change notification
101* Console input
102* Event
103* Memory resource notification
104* Process
105* Semaphore
106* Thread
107* Waitable timer
108
109For example, to perform asynchronous operations on an event, the following
110object may be created:
111
112 HANDLE handle = ::CreateEvent(...);
113 windows::object_handle file(my_io_service, handle);
114
115The `wait()` and `async_wait()` member functions may then be used to wait until
116the kernel object is signalled.
117
118[heading See Also]
119
120[link boost_asio.reference.windows__object_handle windows::object_handle],
121[link boost_asio.reference.windows__basic_object_handle windows::basic_object_handle],
122[link boost_asio.reference.windows__object_handle_service windows::object_handle_service].
123
124[heading Notes]
125
126Windows object `HANDLE`s are only available at compile time when targeting
127Windows. Programs may test for the macro `BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE` to
128determine whether they are supported.
129
130[endsect]
131
132[endsect]