You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2017/08/31 12:41:47 UTC

[08/36] qpid-site git commit: QPID-7903: Refresh the snapshot of the Proton C docs

http://git-wip-us.apache.org/repos/asf/qpid-site/blob/905cafdf/input/releases/qpid-proton-master/proton/cpp/api/multithreaded_client_flow_control_8cpp-example.html
----------------------------------------------------------------------
diff --git a/input/releases/qpid-proton-master/proton/cpp/api/multithreaded_client_flow_control_8cpp-example.html b/input/releases/qpid-proton-master/proton/cpp/api/multithreaded_client_flow_control_8cpp-example.html
index 7ca352a..bf045ba 100644
--- a/input/releases/qpid-proton-master/proton/cpp/api/multithreaded_client_flow_control_8cpp-example.html
+++ b/input/releases/qpid-proton-master/proton/cpp/api/multithreaded_client_flow_control_8cpp-example.html
@@ -94,7 +94,7 @@ $(document).ready(function(){initNavTree('multithreaded_client_flow_control_8cpp
 </div><!--header-->
 <div class="contents">
 <p>A multithreaded sender and receiver enhanced for flow control.<b>Requires C++11</b></p>
-<div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><span class="comment"> * or more contributor license agreements.  See the NOTICE file</span></div><div class="line"><span class="comment"> * distributed with this work for additional information</span></div><div class="line"><span class="comment"> * regarding copyright ownership.  The ASF licenses this file</span></div><div class="line"><span class="comment"> * to you under the Apache License, Version 2.0 (the</span></div><div class="line"><span class="comment"> * &quot;License&quot;); you may not use this file except in compliance</span></div><div class="line"><span class="comment"> * with the License.  You may obtain a copy of the License at</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> *   http://www.apache.org/li
 censes/LICENSE-2.0</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * Unless required by applicable law or agreed to in writing,</span></div><div class="line"><span class="comment"> * software distributed under the License is distributed on an</span></div><div class="line"><span class="comment"> * &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><span class="comment"> * KIND, either express or implied.  See the License for the</span></div><div class="line"><span class="comment"> * specific language governing permissions and limitations</span></div><div class="line"><span class="comment"> * under the License.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"></div><div class="line"><span class="comment">// C++11 only</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// A multi-threaded cli
 ent that sends and receives messages from multiple AMQP</span></div><div class="line"><span class="comment">// addresses.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Demonstrates how to:</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// - implement proton handlers that interact with user threads safely</span></div><div class="line"><span class="comment">// - block sender threads to respect AMQP flow control</span></div><div class="line"><span class="comment">// - use AMQP flow control to limit message buffering for receivers threads</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// We define sender and receiver classes with simple, thread-safe blocking</span></div><div class="line"><span class="comment">// send() and receive() functions.</span></div><div class="line"><span class="comment">//</span></
 div><div class="line"><span class="comment">// These classes are also privately proton::message_handler instances. They use</span></div><div class="line"><span class="comment">// the thread-safe proton::work_queue and standard C++ synchronization (std::mutex</span></div><div class="line"><span class="comment">// etc.) to pass messages between user and proton::container threads.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// NOTE: no proper error handling</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="connection_8hpp.html">proton/connection.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="connection__options_8hpp.html">proton/connection_options.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="container_8hpp.html">proton/container.hpp</a>&gt;</spa
 n></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="message_8hpp.html">proton/message.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="messaging__handler_8hpp.html">proton/messaging_handler.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="receiver_8hpp.html">proton/receiver.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="receiver__options_8hpp.html">proton/receiver_options.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="sender_8hpp.html">proton/sender.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;proton/work_queue.hpp&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;atomic&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;
 condition_variable&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;mutex&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;queue&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;sstream&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;thread&gt;</span></div><div class="line"></div><div class="line"><span class="comment">// Lock output from threads to avoid scramblin</span></div><div class="line">std::mutex out_lock;</div><div class="line"><span class="preprocessor">#define OUT(x) do { std::lock_guard&lt;std::mutex&gt; l(out_lock); x; } while (false)</span></div><div class="line"></div><div class="line"><span class="comment">// A thread-safe sending connection that blocks sending threads when there</span></div><div class="li
 ne"><span class="comment">// is no AMQP credit to send messages.</span></div><div class="line"><span class="keyword">class </span>sender : <span class="keyword">private</span> <a name="_a0"></a><a class="code" href="classproton_1_1messaging__handler.html">proton::messaging_handler</a> {</div><div class="line">    <span class="comment">// Only used in proton handler thread</span></div><div class="line">    <a name="_a1"></a><a class="code" href="classproton_1_1sender.html">proton::sender</a> sender_;</div><div class="line"></div><div class="line">    <span class="comment">// Shared by proton and user threads, protected by lock_</span></div><div class="line">    std::mutex lock_;</div><div class="line">    <a name="_a2"></a><a class="code" href="classproton_1_1work__queue.html">proton::work_queue</a> *work_queue_;</div><div class="line">    std::condition_variable sender_ready_;</div><div class="line">    <span class="keywordtype">int</span> queued_;                       <span class=
 "comment">// Queued messages waiting to be sent</span></div><div class="line">    <span class="keywordtype">int</span> credit_;                       <span class="comment">// AMQP credit - number of messages we can send</span></div><div class="line"></div><div class="line">  <span class="keyword">public</span>:</div><div class="line">    sender(<a name="_a3"></a><a class="code" href="classproton_1_1container.html">proton::container</a>&amp; cont, <span class="keyword">const</span> std::string&amp; url, <span class="keyword">const</span> std::string&amp; address)</div><div class="line">        : work_queue_(0), queued_(0), credit_(0)</div><div class="line">    {</div><div class="line">        cont.<a name="a4"></a><a class="code" href="classproton_1_1container.html#ae0511cbc22f76a538465b9c93d91ccf9">open_sender</a>(url+<span class="stringliteral">&quot;/&quot;</span>+address, <a name="_a5"></a><a class="code" href="classproton_1_1connection__options.html">proton::connection_options</
 a>().handler(*<span class="keyword">this</span>));</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// Thread safe</span></div><div class="line">    <span class="keywordtype">void</span> send(<span class="keyword">const</span> <a name="_a6"></a><a class="code" href="classproton_1_1message.html">proton::message</a>&amp; m) {</div><div class="line">        {</div><div class="line">            std::unique_lock&lt;std::mutex&gt; l(lock_);</div><div class="line">            <span class="comment">// Don&#39;t queue up more messages than we have credit for</span></div><div class="line">            <span class="keywordflow">while</span> (!work_queue_ || queued_ &gt;= credit_) sender_ready_.wait(l);</div><div class="line">            ++queued_;</div><div class="line">        }</div><div class="line">        work_queue_-&gt;<a name="a7"></a><a class="code" href="classproton_1_1work__queue.html#a5a43f2afe9f74bb9281211a22f291140">add</a>([=](
 ) { this-&gt;do_send(m); }); <span class="comment">// work_queue_ is thread safe</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// Thread safe</span></div><div class="line">    <span class="keywordtype">void</span> close() {</div><div class="line">        work_queue()-&gt;add([=]() { sender_.<a name="a8"></a><a class="code" href="classproton_1_1link.html#aff302bb6016f2ae29f01bb4e07389a52">connection</a>().<a name="a9"></a><a class="code" href="classproton_1_1connection.html#a5ae591df94fc66ccb85cbb6565368bca">close</a>(); });</div><div class="line">    }</div><div class="line"></div><div class="line">  <span class="keyword">private</span>:</div><div class="line"></div><div class="line">    <a class="code" href="classproton_1_1work__queue.html">proton::work_queue</a>* work_queue() {</div><div class="line">        <span class="comment">// Wait till work_queue_ and sender_ are initialized.</span></div><div class="line">      
   std::unique_lock&lt;std::mutex&gt; l(lock_);</div><div class="line">        <span class="keywordflow">while</span> (!work_queue_) sender_ready_.wait(l);</div><div class="line">        <span class="keywordflow">return</span> work_queue_;</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// == messaging_handler overrides, only called in proton hander thread</span></div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> <a name="a10"></a><a class="code" href="classproton_1_1messaging__handler.html#a0b5d066e5463d3365f662c8a7dc52661">on_sender_open</a>(<a class="code" href="classproton_1_1sender.html">proton::sender</a>&amp; s)<span class="keyword"> override </span>{</div><div class="line">        <span class="comment">// Make sure sender_ and work_queue_ are set atomically</span></div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        sender_ = s;</div
 ><div class="line">        work_queue_ = &amp;s.<a name="a11"></a><a class="code" href="classproton_1_1link.html#a7c755d6ac6385e007adb61966598ba63">work_queue</a>();</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> <a name="a12"></a><a class="code" href="classproton_1_1messaging__handler.html#aa24f522a68cdf382762702cece7790e7">on_sendable</a>(<a class="code" href="classproton_1_1sender.html">proton::sender</a>&amp; s)<span class="keyword"> override </span>{</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        credit_ = s.<a name="a13"></a><a class="code" href="classproton_1_1link.html#afd27bd11ba72d7df51c44f71b15749eb">credit</a>();</div><div class="line">        sender_ready_.notify_all(); <span class="comment">// Notify senders we have credit</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// work_que
 ue work items is are automatically dequeued and called by proton</span></div><div class="line">    <span class="comment">// This function is called because it was queued by send()</span></div><div class="line">    <span class="keywordtype">void</span> do_send(<span class="keyword">const</span> <a class="code" href="classproton_1_1message.html">proton::message</a>&amp; m) {</div><div class="line">        sender_.<a name="a14"></a><a class="code" href="classproton_1_1sender.html#a214eb30b24e6831d016a47b9dddda830">send</a>(m);</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        --queued_;                    <span class="comment">// work item was consumed from the work_queue</span></div><div class="line">        credit_ = sender_.<a class="code" href="classproton_1_1link.html#afd27bd11ba72d7df51c44f71b15749eb">credit</a>();   <span class="comment">// update credit</span></div><div class="line">        sender_ready_.notify_all();     
   <span class="comment">// Notify senders we have space on queue</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> <a name="a15"></a><a class="code" href="classproton_1_1messaging__handler.html#a5e29fef3b8c5b8cf18aa7d69850ac22e">on_error</a>(<span class="keyword">const</span> <a name="_a16"></a><a class="code" href="classproton_1_1error__condition.html">proton::error_condition</a>&amp; e)<span class="keyword"> override </span>{</div><div class="line">        OUT(std::cerr &lt;&lt; <span class="stringliteral">&quot;unexpected error: &quot;</span> &lt;&lt; e &lt;&lt; std::endl);</div><div class="line">        exit(1);</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// A thread safe receiving connection that blocks receiving threads when there</span></div><div class="line"><span class="comment">// are no messages available, and maintains
  a bounded buffer of incoming</span></div><div class="line"><span class="comment">// messages by issuing AMQP credit only when there is space in the buffer.</span></div><div class="line"><span class="keyword">class </span>receiver : <span class="keyword">private</span> <a class="code" href="classproton_1_1messaging__handler.html">proton::messaging_handler</a> {</div><div class="line">    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> MAX_BUFFER = 100; <span class="comment">// Max number of buffered messages</span></div><div class="line"></div><div class="line">    <span class="comment">// Used in proton threads only</span></div><div class="line">    <a name="_a17"></a><a class="code" href="classproton_1_1receiver.html">proton::receiver</a> receiver_;</div><div class="line"></div><div class="line">    <span class="comment">// Used in proton and user threads, protected by lock_</span></div><div class="line">    std::mutex
  lock_;</div><div class="line">    <a class="code" href="classproton_1_1work__queue.html">proton::work_queue</a>* work_queue_;</div><div class="line">    std::queue&lt;proton::message&gt; buffer_; <span class="comment">// Messages not yet returned by receive()</span></div><div class="line">    std::condition_variable can_receive_; <span class="comment">// Notify receivers of messages</span></div><div class="line"></div><div class="line">  <span class="keyword">public</span>:</div><div class="line"></div><div class="line">    <span class="comment">// Connect to url</span></div><div class="line">    receiver(<a class="code" href="classproton_1_1container.html">proton::container</a>&amp; cont, <span class="keyword">const</span> std::string&amp; url, <span class="keyword">const</span> std::string&amp; address)</div><div class="line">        : work_queue_()</div><div class="line">    {</div><div class="line">        <span class="comment">// NOTE:credit_window(0) disables automatic flow c
 ontrol.</span></div><div class="line">        <span class="comment">// We will use flow control to match AMQP credit to buffer capacity.</span></div><div class="line">        cont.<a name="a18"></a><a class="code" href="classproton_1_1container.html#ac4f8ffaa917c20c8c89106948c2a19c3">open_receiver</a>(url+<span class="stringliteral">&quot;/&quot;</span>+address, <a name="_a19"></a><a class="code" href="classproton_1_1receiver__options.html">proton::receiver_options</a>().credit_window(0),</div><div class="line">                           <a class="code" href="classproton_1_1connection__options.html">proton::connection_options</a>().handler(*<span class="keyword">this</span>));</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// Thread safe receive</span></div><div class="line">    <a class="code" href="classproton_1_1message.html">proton::message</a> receive() {</div><div class="line">        std::unique_lock&lt;std::mutex&gt; l(l
 ock_);</div><div class="line">        <span class="comment">// Wait for buffered messages</span></div><div class="line">        <span class="keywordflow">while</span> (!work_queue_ || buffer_.empty())</div><div class="line">            can_receive_.wait(l);</div><div class="line">        <a class="code" href="classproton_1_1message.html">proton::message</a> m = std::move(buffer_.front());</div><div class="line">        buffer_.pop();</div><div class="line">        <span class="comment">// Add a lambda to the work queue to call receive_done().</span></div><div class="line">        <span class="comment">// This will tell the handler to add more credit.</span></div><div class="line">        work_queue_-&gt;<a class="code" href="classproton_1_1work__queue.html#a5a43f2afe9f74bb9281211a22f291140">add</a>([=]() { this-&gt;receive_done(); });</div><div class="line">        <span class="keywordflow">return</span> m;</div><div class="line">    }</div><div class="line"></div><div class="line">
     <span class="keywordtype">void</span> close() {</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        <span class="keywordflow">if</span> (work_queue_) work_queue_-&gt;<a class="code" href="classproton_1_1work__queue.html#a5a43f2afe9f74bb9281211a22f291140">add</a>([<span class="keyword">this</span>]() { this-&gt;receiver_.<a class="code" href="classproton_1_1link.html#aff302bb6016f2ae29f01bb4e07389a52">connection</a>().<a class="code" href="classproton_1_1connection.html#a5ae591df94fc66ccb85cbb6565368bca">close</a>(); });</div><div class="line">    }</div><div class="line"></div><div class="line">  <span class="keyword">private</span>:</div><div class="line">    <span class="comment">// ==== The following are called by proton threads only.</span></div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> on_receiver_open(<a class="code" href="classproton_1_1receiver.html">proton::receiver</a>&amp; 
 r)<span class="keyword"> override </span>{</div><div class="line">        receiver_ = r;</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        work_queue_ = &amp;receiver_.<a class="code" href="classproton_1_1link.html#a7c755d6ac6385e007adb61966598ba63">work_queue</a>();</div><div class="line">        receiver_.<a name="a20"></a><a class="code" href="classproton_1_1receiver.html#a84d3a001340d11201e03c6ed7c763641">add_credit</a>(MAX_BUFFER); <span class="comment">// Buffer is empty, initial credit is the limit</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> on_message(<a name="_a21"></a><a class="code" href="classproton_1_1delivery.html">proton::delivery</a> &amp;d, <a class="code" href="classproton_1_1message.html">proton::message</a> &amp;m)<span class="keyword"> override </span>{</div><div class="line">        <span class="comment">// Proton automaticall
 y reduces credit by 1 before calling on_message</span></div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        buffer_.push(m);</div><div class="line">        can_receive_.notify_all();</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// called via work_queue</span></div><div class="line">    <span class="keywordtype">void</span> receive_done() {</div><div class="line">        <span class="comment">// Add 1 credit, a receiver has taken a message out of the buffer.</span></div><div class="line">        receiver_.<a class="code" href="classproton_1_1receiver.html#a84d3a001340d11201e03c6ed7c763641">add_credit</a>(1);</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> on_error(<span class="keyword">const</span> <a class="code" href="classproton_1_1error__condition.html">proton::error_condition</a>&amp; e)<span class="ke
 yword"> override </span>{</div><div class="line">        OUT(std::cerr &lt;&lt; <span class="stringliteral">&quot;unexpected error: &quot;</span> &lt;&lt; e &lt;&lt; std::endl);</div><div class="line">        exit(1);</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// ==== Example code using the sender and receiver</span></div><div class="line"></div><div class="line"><span class="comment">// Send n messages</span></div><div class="line"><span class="keywordtype">void</span> send_thread(sender&amp; s, <span class="keywordtype">int</span> n) {</div><div class="line">    <span class="keyword">auto</span> <span class="keywordtype">id</span> = std::this_thread::get_id();</div><div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {</div><div class="line">        std::ostringstream ss;</div><div class="line">        ss &lt;&lt; std::this_thread::get_
 id() &lt;&lt; <span class="stringliteral">&quot;:&quot;</span> &lt;&lt; i;</div><div class="line">        s.send(<a class="code" href="classproton_1_1message.html">proton::message</a>(ss.str()));</div><div class="line">        OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; received: &quot;</span> &lt;&lt; ss.str() &lt;&lt; std::endl);</div><div class="line">    }</div><div class="line">    OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; sent &quot;</span> &lt;&lt; n &lt;&lt; std::endl);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">// Receive messages till atomic remaining count is 0.</span></div><div class="line"><span class="comment">// remaining is shared among all receiving threads</span></div><div class="line"><span class="keywordtype">void</span> receive_thread(receiver&amp; r, std::atomic_int&amp; remaining) {</div><div
  class="line">    <span class="keyword">auto</span> <span class="keywordtype">id</span> = std::this_thread::get_id();</div><div class="line">    <span class="keywordtype">int</span> n = 0;</div><div class="line">    <span class="comment">// atomically check and decrement remaining *before* receiving.</span></div><div class="line">    <span class="comment">// If it is 0 or less then return, as there are no more</span></div><div class="line">    <span class="comment">// messages to receive so calling r.receive() would block forever.</span></div><div class="line">    <span class="keywordflow">while</span> (remaining-- &gt; 0) {</div><div class="line">        <span class="keyword">auto</span> m = r.receive();</div><div class="line">        ++n;</div><div class="line">        OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; received: &quot;</span> &lt;&lt; m.body() &lt;&lt; std::endl);</div><div class="line">    }</div><div class="lin
 e">    OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; received &quot;</span> &lt;&lt; n &lt;&lt; <span class="stringliteral">&quot; messages&quot;</span> &lt;&lt; std::endl);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span> **argv) {</div><div class="line">    <span class="keywordflow">try</span> {</div><div class="line">        <span class="keywordflow">if</span> (argc != 5) {</div><div class="line">            std::cerr &lt;&lt;</div><div class="line">                <span class="stringliteral">&quot;Usage: &quot;</span> &lt;&lt; argv[0] &lt;&lt; <span class="stringliteral">&quot; MESSAGE-COUNT THREAD-COUNT URL\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;CONNECTION-URL: connection address, e.g.&#39;amqp:/
 /127.0.0.1&#39;\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;AMQP-ADDRESS: AMQP node address, e.g. &#39;examples&#39;\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;MESSAGE-COUNT: number of messages to send\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;THREAD-COUNT: number of sender/receiver thread pairs\n&quot;</span>;</div><div class="line">            <span class="keywordflow">return</span> 1;</div><div class="line">        }</div><div class="line"></div><div class="line">        <span class="keyword">const</span> <span class="keywordtype">char</span> *url = argv[1];</div><div class="line">        <span class="keyword">const</span> <span class="keywordtype">char</span> *address = argv[2];</div><div class="line">        <span class="keywordtype">int</span> n_messages = atoi(argv[3]);</div><div class="line">        <span class="keywordtype">int</span> n_thre
 ads = atoi(argv[4]);</div><div class="line">        <span class="keywordtype">int</span> count = n_messages * n_threads;</div><div class="line"></div><div class="line">        <span class="comment">// Total messages to be received, multiple receiver threads will decrement this.</span></div><div class="line">        std::atomic_int remaining(count);</div><div class="line"></div><div class="line">        <span class="comment">// Run the proton container</span></div><div class="line">        <a class="code" href="classproton_1_1container.html">proton::container</a> container;</div><div class="line">        <span class="keyword">auto</span> container_thread = std::thread([&amp;]() { container.<a name="a22"></a><a class="code" href="classproton_1_1container.html#a13a43e6d814de94978c515cb084873b1">run</a>(); });</div><div class="line"></div><div class="line">        <span class="comment">// A single sender and receiver to be shared by all the threads</span></div><div class="line">        
 sender send(container, url, address);</div><div class="line">        receiver recv(container, url, address);</div><div class="line"></div><div class="line">        <span class="comment">// Start receiver threads, then sender threads.</span></div><div class="line">        <span class="comment">// Starting receivers first gives all receivers a chance to compete for messages.</span></div><div class="line">        std::vector&lt;std::thread&gt; threads;</div><div class="line">        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_threads; ++i)</div><div class="line">            threads.push_back(std::thread([&amp;]() { receive_thread(recv, remaining); }));</div><div class="line">        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_threads; ++i)</div><div class="line">            threads.push_back(std::thread([&amp;]() { send_thread(send, n_messages); }));</div><div class="line"></div><div class="li
 ne">        <span class="comment">// Wait for threads to finish</span></div><div class="line">        <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; t : threads)</div><div class="line">            t.join();</div><div class="line">        send.close();</div><div class="line">        recv.close();</div><div class="line">        container_thread.join();</div><div class="line">        <span class="keywordflow">if</span> (remaining &gt; 0)</div><div class="line">            <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;not all messages were received&quot;</span>);</div><div class="line">        std::cout &lt;&lt; count &lt;&lt; <span class="stringliteral">&quot; messages sent and received&quot;</span> &lt;&lt; std::endl;</div><div class="line"></div><div class="line">        <span class="keywordflow">return</span> 0;</div><div class="line">    } <span class="keywordflow">catch</span> (<span class="keyword">const<
 /span> std::exception&amp; e) {</div><div class="line">        std::cerr &lt;&lt; e.what() &lt;&lt; std::endl;</div><div class="line">    }</div><div class="line">    <span class="keywordflow">return</span> 1;</div><div class="line">}</div></div><!-- fragment --> </div><!-- contents -->
+<div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><span class="comment"> * or more contributor license agreements.  See the NOTICE file</span></div><div class="line"><span class="comment"> * distributed with this work for additional information</span></div><div class="line"><span class="comment"> * regarding copyright ownership.  The ASF licenses this file</span></div><div class="line"><span class="comment"> * to you under the Apache License, Version 2.0 (the</span></div><div class="line"><span class="comment"> * &quot;License&quot;); you may not use this file except in compliance</span></div><div class="line"><span class="comment"> * with the License.  You may obtain a copy of the License at</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> *   http://www.apache.org/li
 censes/LICENSE-2.0</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * Unless required by applicable law or agreed to in writing,</span></div><div class="line"><span class="comment"> * software distributed under the License is distributed on an</span></div><div class="line"><span class="comment"> * &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><span class="comment"> * KIND, either express or implied.  See the License for the</span></div><div class="line"><span class="comment"> * specific language governing permissions and limitations</span></div><div class="line"><span class="comment"> * under the License.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"></div><div class="line"><span class="comment">// C++11 only</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// A multi-threaded cli
 ent that sends and receives messages from multiple AMQP</span></div><div class="line"><span class="comment">// addresses.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Demonstrates how to:</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// - implement proton handlers that interact with user threads safely</span></div><div class="line"><span class="comment">// - block sender threads to respect AMQP flow control</span></div><div class="line"><span class="comment">// - use AMQP flow control to limit message buffering for receivers threads</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// We define sender and receiver classes with simple, thread-safe blocking</span></div><div class="line"><span class="comment">// send() and receive() functions.</span></div><div class="line"><span class="comment">//</span></
 div><div class="line"><span class="comment">// These classes are also privately proton::message_handler instances. They use</span></div><div class="line"><span class="comment">// the thread-safe proton::work_queue and standard C++ synchronization (std::mutex</span></div><div class="line"><span class="comment">// etc.) to pass messages between user and proton::container threads.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// NOTE: no proper error handling</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="connection_8hpp.html">proton/connection.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="connection__options_8hpp.html">proton/connection_options.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="container_8hpp.html">proton/container.hpp</a>&gt;</spa
 n></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="message_8hpp.html">proton/message.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="messaging__handler_8hpp.html">proton/messaging_handler.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="receiver_8hpp.html">proton/receiver.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="receiver__options_8hpp.html">proton/receiver_options.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="sender_8hpp.html">proton/sender.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;proton/work_queue.hpp&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;atomic&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;
 condition_variable&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;mutex&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;queue&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;sstream&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;thread&gt;</span></div><div class="line"></div><div class="line"><span class="comment">// Lock output from threads to avoid scramblin</span></div><div class="line">std::mutex out_lock;</div><div class="line"><span class="preprocessor">#define OUT(x) do { std::lock_guard&lt;std::mutex&gt; l(out_lock); x; } while (false)</span></div><div class="line"></div><div class="line"><span class="comment">// A thread-safe sending connection that blocks sending threads when there</span></div><div class="li
 ne"><span class="comment">// is no AMQP credit to send messages.</span></div><div class="line"><span class="keyword">class </span>sender : <span class="keyword">private</span> <a name="_a0"></a><a class="code" href="classproton_1_1messaging__handler.html">proton::messaging_handler</a> {</div><div class="line">    <span class="comment">// Only used in proton handler thread</span></div><div class="line">    <a name="_a1"></a><a class="code" href="classproton_1_1sender.html">proton::sender</a> sender_;</div><div class="line"></div><div class="line">    <span class="comment">// Shared by proton and user threads, protected by lock_</span></div><div class="line">    std::mutex lock_;</div><div class="line">    <a name="_a2"></a><a class="code" href="classproton_1_1work__queue.html">proton::work_queue</a> *work_queue_;</div><div class="line">    std::condition_variable sender_ready_;</div><div class="line">    <span class="keywordtype">int</span> queued_;                       <span class=
 "comment">// Queued messages waiting to be sent</span></div><div class="line">    <span class="keywordtype">int</span> credit_;                       <span class="comment">// AMQP credit - number of messages we can send</span></div><div class="line"></div><div class="line">  <span class="keyword">public</span>:</div><div class="line">    sender(<a name="_a3"></a><a class="code" href="classproton_1_1container.html">proton::container</a>&amp; cont, <span class="keyword">const</span> std::string&amp; url, <span class="keyword">const</span> std::string&amp; address)</div><div class="line">        : work_queue_(0), queued_(0), credit_(0)</div><div class="line">    {</div><div class="line">        cont.<a name="a4"></a><a class="code" href="classproton_1_1container.html#ae0511cbc22f76a538465b9c93d91ccf9">open_sender</a>(url+<span class="stringliteral">&quot;/&quot;</span>+address, <a name="_a5"></a><a class="code" href="classproton_1_1connection__options.html">proton::connection_options</
 a>().handler(*<span class="keyword">this</span>));</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// Thread safe</span></div><div class="line">    <span class="keywordtype">void</span> send(<span class="keyword">const</span> <a name="_a6"></a><a class="code" href="classproton_1_1message.html">proton::message</a>&amp; m) {</div><div class="line">        {</div><div class="line">            std::unique_lock&lt;std::mutex&gt; l(lock_);</div><div class="line">            <span class="comment">// Don&#39;t queue up more messages than we have credit for</span></div><div class="line">            <span class="keywordflow">while</span> (!work_queue_ || queued_ &gt;= credit_) sender_ready_.wait(l);</div><div class="line">            ++queued_;</div><div class="line">        }</div><div class="line">        work_queue_-&gt;<a name="a7"></a><a class="code" href="classproton_1_1work__queue.html#a5a43f2afe9f74bb9281211a22f291140">add</a>([=](
 ) { this-&gt;do_send(m); }); <span class="comment">// work_queue_ is thread safe</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// Thread safe</span></div><div class="line">    <span class="keywordtype">void</span> close() {</div><div class="line">        work_queue()-&gt;add([=]() { sender_.<a name="a8"></a><a class="code" href="classproton_1_1link.html#aff302bb6016f2ae29f01bb4e07389a52">connection</a>().<a name="a9"></a><a class="code" href="classproton_1_1connection.html#a5ae591df94fc66ccb85cbb6565368bca">close</a>(); });</div><div class="line">    }</div><div class="line"></div><div class="line">  <span class="keyword">private</span>:</div><div class="line"></div><div class="line">    <a class="code" href="classproton_1_1work__queue.html">proton::work_queue</a>* work_queue() {</div><div class="line">        <span class="comment">// Wait till work_queue_ and sender_ are initialized.</span></div><div class="line">      
   std::unique_lock&lt;std::mutex&gt; l(lock_);</div><div class="line">        <span class="keywordflow">while</span> (!work_queue_) sender_ready_.wait(l);</div><div class="line">        <span class="keywordflow">return</span> work_queue_;</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// == messaging_handler overrides, only called in proton hander thread</span></div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> <a name="a10"></a><a class="code" href="classproton_1_1messaging__handler.html#a0b5d066e5463d3365f662c8a7dc52661">on_sender_open</a>(<a class="code" href="classproton_1_1sender.html">proton::sender</a>&amp; s)<span class="keyword"> override </span>{</div><div class="line">        <span class="comment">// Make sure sender_ and work_queue_ are set atomically</span></div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        sender_ = s;</div
 ><div class="line">        work_queue_ = &amp;s.<a name="a11"></a><a class="code" href="classproton_1_1link.html#a7c755d6ac6385e007adb61966598ba63">work_queue</a>();</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> <a name="a12"></a><a class="code" href="classproton_1_1messaging__handler.html#aa24f522a68cdf382762702cece7790e7">on_sendable</a>(<a class="code" href="classproton_1_1sender.html">proton::sender</a>&amp; s)<span class="keyword"> override </span>{</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        credit_ = s.<a name="a13"></a><a class="code" href="classproton_1_1link.html#afd27bd11ba72d7df51c44f71b15749eb">credit</a>();</div><div class="line">        sender_ready_.notify_all(); <span class="comment">// Notify senders we have credit</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// work_que
 ue work items is are automatically dequeued and called by proton</span></div><div class="line">    <span class="comment">// This function is called because it was queued by send()</span></div><div class="line">    <span class="keywordtype">void</span> do_send(<span class="keyword">const</span> <a class="code" href="classproton_1_1message.html">proton::message</a>&amp; m) {</div><div class="line">        sender_.<a name="a14"></a><a class="code" href="classproton_1_1sender.html#a214eb30b24e6831d016a47b9dddda830">send</a>(m);</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        --queued_;                    <span class="comment">// work item was consumed from the work_queue</span></div><div class="line">        credit_ = sender_.<a class="code" href="classproton_1_1link.html#afd27bd11ba72d7df51c44f71b15749eb">credit</a>();   <span class="comment">// update credit</span></div><div class="line">        sender_ready_.notify_all();     
   <span class="comment">// Notify senders we have space on queue</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> <a name="a15"></a><a class="code" href="classproton_1_1messaging__handler.html#a5e29fef3b8c5b8cf18aa7d69850ac22e">on_error</a>(<span class="keyword">const</span> <a name="_a16"></a><a class="code" href="classproton_1_1error__condition.html">proton::error_condition</a>&amp; e)<span class="keyword"> override </span>{</div><div class="line">        OUT(std::cerr &lt;&lt; <span class="stringliteral">&quot;unexpected error: &quot;</span> &lt;&lt; e &lt;&lt; std::endl);</div><div class="line">        exit(1);</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// A thread safe receiving connection that blocks receiving threads when there</span></div><div class="line"><span class="comment">// are no messages available, and maintains
  a bounded buffer of incoming</span></div><div class="line"><span class="comment">// messages by issuing AMQP credit only when there is space in the buffer.</span></div><div class="line"><span class="keyword">class </span>receiver : <span class="keyword">private</span> <a class="code" href="classproton_1_1messaging__handler.html">proton::messaging_handler</a> {</div><div class="line">    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> MAX_BUFFER = 100; <span class="comment">// Max number of buffered messages</span></div><div class="line"></div><div class="line">    <span class="comment">// Used in proton threads only</span></div><div class="line">    <a name="_a17"></a><a class="code" href="classproton_1_1receiver.html">proton::receiver</a> receiver_;</div><div class="line"></div><div class="line">    <span class="comment">// Used in proton and user threads, protected by lock_</span></div><div class="line">    std::mutex
  lock_;</div><div class="line">    <a class="code" href="classproton_1_1work__queue.html">proton::work_queue</a>* work_queue_;</div><div class="line">    std::queue&lt;proton::message&gt; buffer_; <span class="comment">// Messages not yet returned by receive()</span></div><div class="line">    std::condition_variable can_receive_; <span class="comment">// Notify receivers of messages</span></div><div class="line"></div><div class="line">  <span class="keyword">public</span>:</div><div class="line"></div><div class="line">    <span class="comment">// Connect to url</span></div><div class="line">    receiver(<a class="code" href="classproton_1_1container.html">proton::container</a>&amp; cont, <span class="keyword">const</span> std::string&amp; url, <span class="keyword">const</span> std::string&amp; address)</div><div class="line">        : work_queue_()</div><div class="line">    {</div><div class="line">        <span class="comment">// NOTE:credit_window(0) disables automatic flow c
 ontrol.</span></div><div class="line">        <span class="comment">// We will use flow control to match AMQP credit to buffer capacity.</span></div><div class="line">        cont.<a name="a18"></a><a class="code" href="classproton_1_1container.html#ac4f8ffaa917c20c8c89106948c2a19c3">open_receiver</a>(url+<span class="stringliteral">&quot;/&quot;</span>+address, <a name="_a19"></a><a class="code" href="classproton_1_1receiver__options.html">proton::receiver_options</a>().credit_window(0),</div><div class="line">                           <a class="code" href="classproton_1_1connection__options.html">proton::connection_options</a>().handler(*<span class="keyword">this</span>));</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// Thread safe receive</span></div><div class="line">    <a class="code" href="classproton_1_1message.html">proton::message</a> receive() {</div><div class="line">        std::unique_lock&lt;std::mutex&gt; l(l
 ock_);</div><div class="line">        <span class="comment">// Wait for buffered messages</span></div><div class="line">        <span class="keywordflow">while</span> (!work_queue_ || buffer_.empty())</div><div class="line">            can_receive_.wait(l);</div><div class="line">        <a class="code" href="classproton_1_1message.html">proton::message</a> m = std::move(buffer_.front());</div><div class="line">        buffer_.pop();</div><div class="line">        <span class="comment">// Add a lambda to the work queue to call receive_done().</span></div><div class="line">        <span class="comment">// This will tell the handler to add more credit.</span></div><div class="line">        work_queue_-&gt;<a class="code" href="classproton_1_1work__queue.html#a5a43f2afe9f74bb9281211a22f291140">add</a>([=]() { this-&gt;receive_done(); });</div><div class="line">        <span class="keywordflow">return</span> m;</div><div class="line">    }</div><div class="line"></div><div class="line">
     <span class="keywordtype">void</span> close() {</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        <span class="keywordflow">if</span> (work_queue_) work_queue_-&gt;<a class="code" href="classproton_1_1work__queue.html#a5a43f2afe9f74bb9281211a22f291140">add</a>([<span class="keyword">this</span>]() { this-&gt;receiver_.<a class="code" href="classproton_1_1link.html#aff302bb6016f2ae29f01bb4e07389a52">connection</a>().<a class="code" href="classproton_1_1connection.html#a5ae591df94fc66ccb85cbb6565368bca">close</a>(); });</div><div class="line">    }</div><div class="line"></div><div class="line">  <span class="keyword">private</span>:</div><div class="line">    <span class="comment">// ==== The following are called by proton threads only.</span></div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> on_receiver_open(<a class="code" href="classproton_1_1receiver.html">proton::receiver</a>&amp; 
 r)<span class="keyword"> override </span>{</div><div class="line">        receiver_ = r;</div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        work_queue_ = &amp;receiver_.<a class="code" href="classproton_1_1link.html#a7c755d6ac6385e007adb61966598ba63">work_queue</a>();</div><div class="line">        receiver_.<a name="a20"></a><a class="code" href="classproton_1_1receiver.html#a84d3a001340d11201e03c6ed7c763641">add_credit</a>(MAX_BUFFER); <span class="comment">// Buffer is empty, initial credit is the limit</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> on_message(<a name="_a21"></a><a class="code" href="classproton_1_1delivery.html">proton::delivery</a> &amp;d, <a class="code" href="classproton_1_1message.html">proton::message</a> &amp;m)<span class="keyword"> override </span>{</div><div class="line">        <span class="comment">// Proton automaticall
 y reduces credit by 1 before calling on_message</span></div><div class="line">        std::lock_guard&lt;std::mutex&gt; l(lock_);</div><div class="line">        buffer_.push(m);</div><div class="line">        can_receive_.notify_all();</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">// called via work_queue</span></div><div class="line">    <span class="keywordtype">void</span> receive_done() {</div><div class="line">        <span class="comment">// Add 1 credit, a receiver has taken a message out of the buffer.</span></div><div class="line">        receiver_.<a class="code" href="classproton_1_1receiver.html#a84d3a001340d11201e03c6ed7c763641">add_credit</a>(1);</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">void</span> on_error(<span class="keyword">const</span> <a class="code" href="classproton_1_1error__condition.html">proton::error_condition</a>&amp; e)<span class="ke
 yword"> override </span>{</div><div class="line">        OUT(std::cerr &lt;&lt; <span class="stringliteral">&quot;unexpected error: &quot;</span> &lt;&lt; e &lt;&lt; std::endl);</div><div class="line">        exit(1);</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// ==== Example code using the sender and receiver</span></div><div class="line"></div><div class="line"><span class="comment">// Send n messages</span></div><div class="line"><span class="keywordtype">void</span> send_thread(sender&amp; s, <span class="keywordtype">int</span> n) {</div><div class="line">    <span class="keyword">auto</span> <span class="keywordtype">id</span> = std::this_thread::get_id();</div><div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {</div><div class="line">        std::ostringstream ss;</div><div class="line">        ss &lt;&lt; std::this_thread::get_
 id() &lt;&lt; <span class="stringliteral">&quot;-&quot;</span> &lt;&lt; i;</div><div class="line">        s.send(<a class="code" href="classproton_1_1message.html">proton::message</a>(ss.str()));</div><div class="line">        OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; sent \&quot;&quot;</span> &lt;&lt; ss.str() &lt;&lt; <span class="charliteral">&#39;&quot;&#39;</span> &lt;&lt; std::endl);</div><div class="line">    }</div><div class="line">    OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; sent &quot;</span> &lt;&lt; n &lt;&lt; std::endl);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">// Receive messages till atomic remaining count is 0.</span></div><div class="line"><span class="comment">// remaining is shared among all receiving threads</span></div><div class="line"><span class="keywordtype">void</span> receive_thread
 (receiver&amp; r, std::atomic_int&amp; remaining) {</div><div class="line">    <span class="keyword">auto</span> <span class="keywordtype">id</span> = std::this_thread::get_id();</div><div class="line">    <span class="keywordtype">int</span> n = 0;</div><div class="line">    <span class="comment">// atomically check and decrement remaining *before* receiving.</span></div><div class="line">    <span class="comment">// If it is 0 or less then return, as there are no more</span></div><div class="line">    <span class="comment">// messages to receive so calling r.receive() would block forever.</span></div><div class="line">    <span class="keywordflow">while</span> (remaining-- &gt; 0) {</div><div class="line">        <span class="keyword">auto</span> m = r.receive();</div><div class="line">        ++n;</div><div class="line">        OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; received \&quot;&quot;</span> &lt;&lt; m.body() &lt
 ;&lt; <span class="charliteral">&#39;&quot;&#39;</span> &lt;&lt; std::endl);</div><div class="line">    }</div><div class="line">    OUT(std::cout &lt;&lt; <span class="keywordtype">id</span> &lt;&lt; <span class="stringliteral">&quot; received &quot;</span> &lt;&lt; n &lt;&lt; <span class="stringliteral">&quot; messages&quot;</span> &lt;&lt; std::endl);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span> **argv) {</div><div class="line">    <span class="keywordflow">try</span> {</div><div class="line">        <span class="keywordflow">if</span> (argc != 5) {</div><div class="line">            std::cerr &lt;&lt;</div><div class="line">                <span class="stringliteral">&quot;Usage: &quot;</span> &lt;&lt; argv[0] &lt;&lt; <span class="stringliteral">&quot; MESSAGE-COUNT THREAD-COUNT URL\n&quot;</span
 ></div><div class="line">                <span class="stringliteral">&quot;CONNECTION-URL: connection address, e.g.&#39;amqp://127.0.0.1&#39;\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;AMQP-ADDRESS: AMQP node address, e.g. &#39;examples&#39;\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;MESSAGE-COUNT: number of messages to send\n&quot;</span></div><div class="line">                <span class="stringliteral">&quot;THREAD-COUNT: number of sender/receiver thread pairs\n&quot;</span>;</div><div class="line">            <span class="keywordflow">return</span> 1;</div><div class="line">        }</div><div class="line"></div><div class="line">        <span class="keyword">const</span> <span class="keywordtype">char</span> *url = argv[1];</div><div class="line">        <span class="keyword">const</span> <span class="keywordtype">char</span> *address = argv[2];</div><div class="line">        <span class="
 keywordtype">int</span> n_messages = atoi(argv[3]);</div><div class="line">        <span class="keywordtype">int</span> n_threads = atoi(argv[4]);</div><div class="line">        <span class="keywordtype">int</span> count = n_messages * n_threads;</div><div class="line"></div><div class="line">        <span class="comment">// Total messages to be received, multiple receiver threads will decrement this.</span></div><div class="line">        std::atomic_int remaining(count);</div><div class="line"></div><div class="line">        <span class="comment">// Run the proton container</span></div><div class="line">        <a class="code" href="classproton_1_1container.html">proton::container</a> container;</div><div class="line">        <span class="keyword">auto</span> container_thread = std::thread([&amp;]() { container.<a name="a22"></a><a class="code" href="classproton_1_1container.html#a13a43e6d814de94978c515cb084873b1">run</a>(); });</div><div class="line"></div><div class="line">      
   <span class="comment">// A single sender and receiver to be shared by all the threads</span></div><div class="line">        sender send(container, url, address);</div><div class="line">        receiver recv(container, url, address);</div><div class="line"></div><div class="line">        <span class="comment">// Start receiver threads, then sender threads.</span></div><div class="line">        <span class="comment">// Starting receivers first gives all receivers a chance to compete for messages.</span></div><div class="line">        std::vector&lt;std::thread&gt; threads;</div><div class="line">        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_threads; ++i)</div><div class="line">            threads.push_back(std::thread([&amp;]() { receive_thread(recv, remaining); }));</div><div class="line">        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_threads; ++i)</div><div class="line">       
      threads.push_back(std::thread([&amp;]() { send_thread(send, n_messages); }));</div><div class="line"></div><div class="line">        <span class="comment">// Wait for threads to finish</span></div><div class="line">        <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; t : threads)</div><div class="line">            t.join();</div><div class="line">        send.close();</div><div class="line">        recv.close();</div><div class="line">        container_thread.join();</div><div class="line">        <span class="keywordflow">if</span> (remaining &gt; 0)</div><div class="line">            <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;not all messages were received&quot;</span>);</div><div class="line">        std::cout &lt;&lt; count &lt;&lt; <span class="stringliteral">&quot; messages sent and received&quot;</span> &lt;&lt; std::endl;</div><div class="line"></div><div class="line">        <span class="k
 eywordflow">return</span> 0;</div><div class="line">    } <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception&amp; e) {</div><div class="line">        std::cerr &lt;&lt; e.what() &lt;&lt; std::endl;</div><div class="line">    }</div><div class="line">    <span class="keywordflow">return</span> 1;</div><div class="line">}</div></div><!-- fragment --> </div><!-- contents -->
 </div><!-- doc-content -->
 <!-- start footer part -->
 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->

http://git-wip-us.apache.org/repos/asf/qpid-site/blob/905cafdf/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton.html
----------------------------------------------------------------------
diff --git a/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton.html b/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton.html
index 7d61e0c..909a6b6 100644
--- a/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton.html
+++ b/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton.html
@@ -105,10 +105,10 @@ $(document).ready(function(){initNavTree('namespaceproton.html','');});
 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
 Namespaces</h2></td></tr>
 <tr class="memitem:namespaceproton_1_1codec"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceproton_1_1codec.html">codec</a></td></tr>
-<tr class="memdesc:namespaceproton_1_1codec"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - AMQP data encoding and decoding. <br /></td></tr>
+<tr class="memdesc:namespaceproton_1_1codec"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - AMQP data encoding and decoding. <br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:namespaceproton_1_1io"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceproton_1_1io.html">io</a></td></tr>
-<tr class="memdesc:namespaceproton_1_1io"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - An SPI for multithreaded network IO. <br /></td></tr>
+<tr class="memdesc:namespaceproton_1_1io"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - An SPI for multithreaded network IO. <br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 </table><table class="memberdecls">
 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
@@ -165,13 +165,13 @@ Classes</h2></td></tr>
 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A named channel for sending or receiving messages.  <a href="classproton_1_1link.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1listen__handler.html">listen_handler</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - A handler for incoming connections.  <a href="classproton_1_1listen__handler.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - A handler for incoming connections.  <a href="classproton_1_1listen__handler.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1listener.html">listener</a></td></tr>
 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A listener for incoming connections.  <a href="classproton_1_1listener.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1map.html">map</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used to access standard AMQP property, annotation and filter maps attached to <a class="el" href="classproton_1_1message.html" title="An AMQP message. ">proton::message</a> and <a class="el" href="classproton_1_1source.html" title="A point of origin for messages. ">proton::source</a>.  <a href="classproton_1_1map.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A collection of key-value pairs.  <a href="classproton_1_1map.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1message.html">message</a></td></tr>
 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An AMQP message.  <a href="classproton_1_1message.html#details">More...</a><br /></td></tr>
@@ -222,16 +222,16 @@ Classes</h2></td></tr>
 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">SSL information.  <a href="classproton_1_1ssl.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1ssl__certificate.html">ssl_certificate</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - An SSL certificate.  <a href="classproton_1_1ssl__certificate.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - An SSL certificate.  <a href="classproton_1_1ssl__certificate.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1ssl__client__options.html">ssl_client_options</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - SSL configuration for outbound connections.  <a href="classproton_1_1ssl__client__options.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - SSL configuration for outbound connections.  <a href="classproton_1_1ssl__client__options.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1ssl__server__options.html">ssl_server_options</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - SSL configuration for inbound connections.  <a href="classproton_1_1ssl__server__options.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - SSL configuration for inbound connections.  <a href="classproton_1_1ssl__server__options.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1symbol.html">symbol</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A std::string that represents the AMQP symbol type.  <a href="classproton_1_1symbol.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <code>std::string</code> that represents the AMQP symbol type.  <a href="classproton_1_1symbol.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1target.html">target</a></td></tr>
 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A destination for messages.  <a href="classproton_1_1target.html#details">More...</a><br /></td></tr>
@@ -273,10 +273,10 @@ Classes</h2></td></tr>
 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A C++03 compatible void no-argument callback function object.  <a href="classproton_1_1void__function0.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1work.html">work</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - Work to be queued on a <a class="el" href="classproton_1_1work__queue.html">work_queue</a>.  <a href="classproton_1_1work.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - Work to be queued on a <a class="el" href="classproton_1_1work__queue.html">work_queue</a>.  <a href="classproton_1_1work.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1work__queue.html">work_queue</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - A work queue for serial execution.  <a href="classproton_1_1work__queue.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - A work queue for serial execution.  <a href="classproton_1_1work__queue.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 </table><table class="memberdecls">
 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
@@ -345,17 +345,17 @@ std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="
 <tr class="memitem:a6bf02b4db50d17a060e281c8317a11d0"><td class="memTemplParams" colspan="2"><a id="a6bf02b4db50d17a060e281c8317a11d0"></a>
 template&lt;class K , class T &gt; </td></tr>
 <tr class="memitem:a6bf02b4db50d17a060e281c8317a11d0"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classproton_1_1codec_1_1decoder.html">proton::codec::decoder</a> &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#a6bf02b4db50d17a060e281c8317a11d0">operator&gt;&gt;</a> (<a class="el" href="classproton_1_1codec_1_1decoder.html">proton::codec::decoder</a> &amp;d, <a class="el" href="classproton_1_1map.html">map</a>&lt; K, T &gt; &amp;m)</td></tr>
-<tr class="memdesc:a6bf02b4db50d17a060e281c8317a11d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode from a <a class="el" href="classproton_1_1map.html" title="Used to access standard AMQP property, annotation and filter maps attached to proton::message and pro...">proton::map</a>. <br /></td></tr>
+<tr class="memdesc:a6bf02b4db50d17a060e281c8317a11d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode from a <a class="el" href="classproton_1_1map.html" title="A collection of key-value pairs. ">proton::map</a>. <br /></td></tr>
 <tr class="separator:a6bf02b4db50d17a060e281c8317a11d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:a3ece552dd5bced0c858f7f1ecd5d4e80"><td class="memTemplParams" colspan="2"><a id="a3ece552dd5bced0c858f7f1ecd5d4e80"></a>
 template&lt;class K , class T &gt; </td></tr>
 <tr class="memitem:a3ece552dd5bced0c858f7f1ecd5d4e80"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classproton_1_1codec_1_1encoder.html">proton::codec::encoder</a> &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#a3ece552dd5bced0c858f7f1ecd5d4e80">operator&lt;&lt;</a> (<a class="el" href="classproton_1_1codec_1_1encoder.html">proton::codec::encoder</a> &amp;e, const <a class="el" href="classproton_1_1map.html">map</a>&lt; K, T &gt; &amp;m)</td></tr>
-<tr class="memdesc:a3ece552dd5bced0c858f7f1ecd5d4e80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode to a <a class="el" href="classproton_1_1map.html" title="Used to access standard AMQP property, annotation and filter maps attached to proton::message and pro...">proton::map</a>. <br /></td></tr>
+<tr class="memdesc:a3ece552dd5bced0c858f7f1ecd5d4e80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode to a <a class="el" href="classproton_1_1map.html" title="A collection of key-value pairs. ">proton::map</a>. <br /></td></tr>
 <tr class="separator:a3ece552dd5bced0c858f7f1ecd5d4e80"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:ac316ee696bc5099a42ecec8ed4d8f656"><td class="memTemplParams" colspan="2"><a id="ac316ee696bc5099a42ecec8ed4d8f656"></a>
 template&lt;class K , class T &gt; </td></tr>
 <tr class="memitem:ac316ee696bc5099a42ecec8ed4d8f656"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#ac316ee696bc5099a42ecec8ed4d8f656">swap</a> (<a class="el" href="classproton_1_1map.html">map</a>&lt; K, T &gt; &amp;, <a class="el" href="classproton_1_1map.html">map</a>&lt; K, T &gt; &amp;)</td></tr>
-<tr class="memdesc:ac316ee696bc5099a42ecec8ed4d8f656"><td class="mdescLeft">&#160;</td><td class="mdescRight">Swap <a class="el" href="classproton_1_1map.html" title="Used to access standard AMQP property, annotation and filter maps attached to proton::message and pro...">proton::map</a> instances. <br /></td></tr>
+<tr class="memdesc:ac316ee696bc5099a42ecec8ed4d8f656"><td class="mdescLeft">&#160;</td><td class="mdescRight">Swap <a class="el" href="classproton_1_1map.html" title="A collection of key-value pairs. ">proton::map</a> instances. <br /></td></tr>
 <tr class="separator:ac316ee696bc5099a42ecec8ed4d8f656"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:a2551b903e19d1bc8d4b59ffbe0b53ff5"><td class="memTemplParams" colspan="2">template&lt;&gt; </td></tr>
 <tr class="memitem:a2551b903e19d1bc8d4b59ffbe0b53ff5"><td class="memTemplItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#a2551b903e19d1bc8d4b59ffbe0b53ff5">get&lt; uint64_t &gt;</a> (const <a class="el" href="classproton_1_1message__id.html">message_id</a> &amp;x)</td></tr>
@@ -442,17 +442,17 @@ std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" hre
 <tr class="memitem:ae77a8638d584f5fc99a1bbaf218d2481"><td class="memTemplParams" colspan="2"><a id="ae77a8638d584f5fc99a1bbaf218d2481"></a>
 template&lt;class WQ , class... Rest&gt; </td></tr>
 <tr class="memitem:ae77a8638d584f5fc99a1bbaf218d2481"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#ae77a8638d584f5fc99a1bbaf218d2481">schedule_work</a> (WQ wq, Rest &amp;&amp;... r)</td></tr>
-<tr class="memdesc:ae77a8638d584f5fc99a1bbaf218d2481"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> <br /></td></tr>
+<tr class="memdesc:ae77a8638d584f5fc99a1bbaf218d2481"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> <br /></td></tr>
 <tr class="separator:ae77a8638d584f5fc99a1bbaf218d2481"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:a1150bef2a1d844a7c3ba2244e993ab51"><td class="memTemplParams" colspan="2"><a id="a1150bef2a1d844a7c3ba2244e993ab51"></a>
 template&lt;class WQ , class... Rest&gt; </td></tr>
 <tr class="memitem:a1150bef2a1d844a7c3ba2244e993ab51"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#a1150bef2a1d844a7c3ba2244e993ab51">schedule_work</a> (WQ wq, <a class="el" href="classproton_1_1duration.html">duration</a> d, Rest &amp;&amp;... r)</td></tr>
-<tr class="memdesc:a1150bef2a1d844a7c3ba2244e993ab51"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> <br /></td></tr>
+<tr class="memdesc:a1150bef2a1d844a7c3ba2244e993ab51"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> <br /></td></tr>
 <tr class="separator:a1150bef2a1d844a7c3ba2244e993ab51"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:a8b9a9f4f45c6ee25e0e4516855dc7fc8"><td class="memTemplParams" colspan="2"><a id="a8b9a9f4f45c6ee25e0e4516855dc7fc8"></a>
 template&lt;class... Rest&gt; </td></tr>
 <tr class="memitem:a8b9a9f4f45c6ee25e0e4516855dc7fc8"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classproton_1_1work.html">work</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceproton.html#a8b9a9f4f45c6ee25e0e4516855dc7fc8">make_work</a> (Rest &amp;&amp;... r)</td></tr>
-<tr class="memdesc:a8b9a9f4f45c6ee25e0e4516855dc7fc8"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> <br /></td></tr>
+<tr class="memdesc:a8b9a9f4f45c6ee25e0e4516855dc7fc8"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> <br /></td></tr>
 <tr class="separator:a8b9a9f4f45c6ee25e0e4516855dc7fc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr><td colspan="2"><div class="groupHeader"></div></td></tr>
 <tr class="memitem:aec04001c66a08483b8e23f836da2d621"><td class="memItemLeft" align="right" valign="top"><a id="aec04001c66a08483b8e23f836da2d621"></a>

http://git-wip-us.apache.org/repos/asf/qpid-site/blob/905cafdf/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton_1_1codec.html
----------------------------------------------------------------------
diff --git a/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton_1_1codec.html b/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton_1_1codec.html
index 9878667..8e2233e 100644
--- a/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton_1_1codec.html
+++ b/input/releases/qpid-proton-master/proton/cpp/api/namespaceproton_1_1codec.html
@@ -97,22 +97,22 @@ $(document).ready(function(){initNavTree('namespaceproton_1_1codec.html','');});
 </div><!--header-->
 <div class="contents">
 
-<p><b>Experimental</b> - AMQP data encoding and decoding.  
+<p><b>Unsettled API</b> - AMQP data encoding and decoding.  
 <a href="#details">More...</a></p>
 <table class="memberdecls">
 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
 Classes</h2></td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1codec_1_1decoder.html">decoder</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - Stream-like decoder from AMQP bytes to C++ values.  <a href="classproton_1_1codec_1_1decoder.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - Stream-like decoder from AMQP bytes to C++ values.  <a href="classproton_1_1codec_1_1decoder.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classproton_1_1codec_1_1encoder.html">encoder</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - Stream-like encoder from C++ values to AMQP bytes.  <a href="classproton_1_1codec_1_1encoder.html#details">More...</a><br /></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - Stream-like encoder from C++ values to AMQP bytes.  <a href="classproton_1_1codec_1_1encoder.html#details">More...</a><br /></td></tr>
 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:structproton_1_1codec_1_1finish"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceproton_1_1codec.html#structproton_1_1codec_1_1finish">finish</a></td></tr>
-<tr class="memdesc:structproton_1_1codec_1_1finish"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - Finish inserting or extracting a complex type.  <a href="namespaceproton_1_1codec.html#structproton_1_1codec_1_1finish">More...</a><br /></td></tr>
+<tr class="memdesc:structproton_1_1codec_1_1finish"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - Finish inserting or extracting a complex type.  <a href="namespaceproton_1_1codec.html#structproton_1_1codec_1_1finish">More...</a><br /></td></tr>
 <tr class="separator:structproton_1_1codec_1_1finish"><td class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:structproton_1_1codec_1_1start"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceproton_1_1codec.html#structproton_1_1codec_1_1start">start</a></td></tr>
-<tr class="memdesc:structproton_1_1codec_1_1start"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Experimental</b> - Start encoding a complex type.  <a href="namespaceproton_1_1codec.html#structproton_1_1codec_1_1start">More...</a><br /></td></tr>
+<tr class="memdesc:structproton_1_1codec_1_1start"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>Unsettled API</b> - Start encoding a complex type.  <a href="namespaceproton_1_1codec.html#structproton_1_1codec_1_1start">More...</a><br /></td></tr>
 <tr class="separator:structproton_1_1codec_1_1start"><td class="memSeparator" colspan="2">&#160;</td></tr>
 </table><table class="memberdecls">
 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
@@ -269,7 +269,7 @@ template&lt;class A , class K , class T &gt; </td></tr>
 <tr class="separator:a60e434209337aad807915388c644f68c"><td class="memSeparator" colspan="2">&#160;</td></tr>
 </table>
 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p><b>Experimental</b> - AMQP data encoding and decoding. </p>
+<div class="textblock"><p><b>Unsettled API</b> - AMQP data encoding and decoding. </p>
 <p>You can use these classes on an experimental basis to create your own AMQP encodings for C++ types, but they may change in the future. For examples of use see the built-in encodings, for example in proton/vector.hpp or <a class="el" href="map_8hpp.html" title="Template for AMQP property, annotation and filter maps. ">proton/map.hpp</a> </p>
 </div><hr/><h2 class="groupheader">Class Documentation</h2>
 <a name="structproton_1_1codec_1_1finish" id="structproton_1_1codec_1_1finish"></a>
@@ -283,7 +283,7 @@ template&lt;class A , class K , class T &gt; </td></tr>
         </tr>
       </table>
 </div><div class="memdoc">
-<div class="textblock"><p><b>Experimental</b> - Finish inserting or extracting a complex type. </p>
+<div class="textblock"><p><b>Unsettled API</b> - Finish inserting or extracting a complex type. </p>
 </div>
 </div>
 </div>
@@ -298,7 +298,7 @@ template&lt;class A , class K , class T &gt; </td></tr>
         </tr>
       </table>
 </div><div class="memdoc">
-<div class="textblock"><p><b>Experimental</b> - Start encoding a complex type. </p>
+<div class="textblock"><p><b>Unsettled API</b> - Start encoding a complex type. </p>
 </div>
 </div>
 </div>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org