Imported Upstream version 1.64.0
[platform/upstream/boost.git] / doc / html / boost_asio / overview / windows / stream_handle.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Stream-Oriented HANDLEs</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../windows.html" title="Windows-Specific Functionality">
9 <link rel="prev" href="../windows.html" title="Windows-Specific Functionality">
10 <link rel="next" href="random_access_handle.html" title="Random-Access HANDLEs">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../windows.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../windows.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="random_access_handle.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_asio.overview.windows.stream_handle"></a><a class="link" href="stream_handle.html" title="Stream-Oriented HANDLEs">Stream-Oriented
28         HANDLEs</a>
29 </h4></div></div></div>
30 <p>
31           Boost.Asio contains classes to allow asynchronous read and write operations
32           to be performed on Windows <code class="computeroutput"><span class="identifier">HANDLE</span></code>s,
33           such as named pipes.
34         </p>
35 <p>
36           For example, to perform asynchronous operations on a named pipe, the following
37           object may be created:
38         </p>
39 <pre class="programlisting"><span class="identifier">HANDLE</span> <span class="identifier">handle</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">CreateFile</span><span class="special">(...);</span>
40 <span class="identifier">windows</span><span class="special">::</span><span class="identifier">stream_handle</span> <span class="identifier">pipe</span><span class="special">(</span><span class="identifier">my_io_service</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">);</span>
41 </pre>
42 <p>
43           These are then used as synchronous or asynchronous read and write streams.
44           This means the objects can be used with any of the <a class="link" href="../../reference/read.html" title="read">read()</a>,
45           <a class="link" href="../../reference/async_read.html" title="async_read">async_read()</a>, <a class="link" href="../../reference/write.html" title="write">write()</a>, <a class="link" href="../../reference/async_write.html" title="async_write">async_write()</a>,
46           <a class="link" href="../../reference/read_until.html" title="read_until">read_until()</a> or
47           <a class="link" href="../../reference/async_read_until.html" title="async_read_until">async_read_until()</a>
48           free functions.
49         </p>
50 <p>
51           The kernel object referred to by the <code class="computeroutput"><span class="identifier">HANDLE</span></code>
52           must support use with I/O completion ports (which means that named pipes
53           are supported, but anonymous pipes and console streams are not).
54         </p>
55 <h6>
56 <a name="boost_asio.overview.windows.stream_handle.h0"></a>
57           <span class="phrase"><a name="boost_asio.overview.windows.stream_handle.see_also"></a></span><a class="link" href="stream_handle.html#boost_asio.overview.windows.stream_handle.see_also">See Also</a>
58         </h6>
59 <p>
60           <a class="link" href="../../reference/windows__stream_handle.html" title="windows::stream_handle">windows::stream_handle</a>,
61           <a class="link" href="../../reference/windows__basic_stream_handle.html" title="windows::basic_stream_handle">windows::basic_stream_handle</a>,
62           <a class="link" href="../../reference/windows__stream_handle_service.html" title="windows::stream_handle_service">windows::stream_handle_service</a>.
63         </p>
64 <h6>
65 <a name="boost_asio.overview.windows.stream_handle.h1"></a>
66           <span class="phrase"><a name="boost_asio.overview.windows.stream_handle.notes"></a></span><a class="link" href="stream_handle.html#boost_asio.overview.windows.stream_handle.notes">Notes</a>
67         </h6>
68 <p>
69           Windows stream <code class="computeroutput"><span class="identifier">HANDLE</span></code>s
70           are only available at compile time when targeting Windows and only when
71           the I/O completion port backend is used (which is the default). A program
72           may test for the macro <code class="computeroutput"><span class="identifier">BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE</span></code>
73           to determine whether they are supported.
74         </p>
75 </div>
76 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
77 <td align="left"></td>
78 <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2017 Christopher M. Kohlhoff<p>
79         Distributed under the Boost Software License, Version 1.0. (See accompanying
80         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
81       </p>
82 </div></td>
83 </tr></table>
84 <hr>
85 <div class="spirit-nav">
86 <a accesskey="p" href="../windows.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../windows.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="random_access_handle.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
87 </div>
88 </body>
89 </html>