1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <TITLE>Blocking
</TITLE>
5 <LINK REL=
"stylesheet" HREF=
"../../../../boost.css">
6 <LINK REL=
"stylesheet" HREF=
"../theme/iostreams.css">
12 <H1 CLASS=
"title">Blocking
</H1>
20 A
<A HREF=
"device.html">Device
</A> is Blocking if a
<CODE>read
</CODE> request never produces fewer characters than requested except at end-of-stream, and if a
<CODE>write
</CODE> request never consumes fewer characters than requested under any circumstances. All Devices currently provided with the Iostreams library are Blocking. Limited support for non-Blocking Devices has been provided as a foundation for future more comprehensive support of
<A HREF='../guide/asynchronous.html'
>asynchronous and non-blocking i/o
</A>.
24 The Blocking concept does not apply to filters. Instead, filters are required to be
<SPAN CLASS='term'
>blocking-preserving
</SPAN>, which means that
28 a
<CODE>read
</CODE> request never produces fewer characters than requested unless end-of-stream has been reached or unless a
<CODE>read
</CODE> request to a downsteam Source produces fewer characters than requested, and
31 a
<CODE>write
</CODE> request never consumes fewer characters than requested unless a
<CODE>write
</CODE> request to a downsteam Sink consumes fewer characters than requested.
36 Unlike other Iostreams library concepts, Blocking is not associated with any
<A HREF='../guide/traits.html#category_tags'
>category tag
</A>. In the future, a
<CODE>non_blocking_tag
</CODE> may be introduced.
39 <H2>Refinement of
</H2>
41 <P><A HREF=
"device.html">Device
</A>.
</P>
44 <H2>Associated Types
</H2>
46 <P>Same as
<A HREF=
"device.html">Device
</A>.
</P>
48 <A NAME=
"expressions"></A>
49 <H2>Valid Expressions / Semantics
</H2>
51 <P>Valid expressions are the same as
<A HREF=
"device.html">Device
</A>. The additional semantic requirements are described informally above.
</P>
57 <P CLASS=
"copyright">© Copyright
2008 <a href=
"http://www.coderage.com/" target=
"_top">CodeRage, LLC
</a><br/>© Copyright
2004-
2007 <a href=
"http://www.coderage.com/turkanis/" target=
"_top">Jonathan Turkanis
</a></P>
59 Distributed under the Boost Software License, Version
1.0. (See accompanying file LICENSE_1_0.txt or copy at
<A HREF=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt
</A>)