blob: b8268bf8eddcd00a6204c4650afbc03315448d05 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qpid Proton C++ API: multithreaded_client.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Qpid Proton C++ API
&#160;<span id="projectnumber">0.32.0</span>
</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('multithreaded_client_8cpp-example.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">multithreaded_client.cpp</div> </div>
</div><!--header-->
<div class="contents">
<p>A multithreaded sender and receiver.<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/licenses/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">//</span></div>
<div class="line"><span class="comment">// C++11 or greater</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// A multi-threaded client that calls proton::container::run() in one thread, sends</span></div>
<div class="line"><span class="comment">// messages in another and receives messages in a third.</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// Note this client does not deal with flow-control. If the sender is faster</span></div>
<div class="line"><span class="comment">// than the receiver, messages will build up in memory on the sending side.</span></div>
<div class="line"><span class="comment">// See @ref multithreaded_client_flow_control.cpp for a more complex example with</span></div>
<div class="line"><span class="comment">// flow control.</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;</span></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="sender_8hpp.html">proton/sender.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="work__queue_8hpp.html">proton/work_queue.hpp</a>&gt;</span></div>
<div class="line"> </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 scrambling</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">// Handler for a single thread-safe sending and receiving connection.</span></div>
<div class="line"><span class="keyword">class </span>client : <span class="keyword">public</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">// Invariant</span></div>
<div class="line"> <span class="keyword">const</span> std::string url_;</div>
<div class="line"> <span class="keyword">const</span> std::string address_;</div>
<div class="line"> </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"> std::queue&lt;proton::message&gt; messages_;</div>
<div class="line"> std::condition_variable messages_ready_;</div>
<div class="line"> </div>
<div class="line"> <span class="keyword">public</span>:</div>
<div class="line"> client(<span class="keyword">const</span> std::string&amp; url, <span class="keyword">const</span> std::string&amp; address) : url_(url), address_(address), work_queue_(0) {}</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="_a3"></a><a class="code" href="classproton_1_1message.html">proton::message</a>&amp; msg) {</div>
<div class="line"> <span class="comment">// Use [=] to copy the message, we cannot pass it by reference since it</span></div>
<div class="line"> <span class="comment">// will be used in another thread.</span></div>
<div class="line"> work_queue()-&gt;<a name="a4"></a><a class="code" href="classproton_1_1work__queue.html#a59dae2153455bc095477a3b66a0b681e">add</a>([=]() { sender_.<a name="a5"></a><a class="code" href="classproton_1_1sender.html#a214eb30b24e6831d016a47b9dddda830">send</a>(msg); });</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Thread safe</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(lock_);</div>
<div class="line"> <span class="keywordflow">while</span> (messages_.empty()) messages_ready_.wait(l);</div>
<div class="line"> <span class="keyword">auto</span> msg = std::move(messages_.front());</div>
<div class="line"> messages_.pop();</div>
<div class="line"> <span class="keywordflow">return</span> msg;</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="a6"></a><a class="code" href="classproton_1_1link.html#aff302bb6016f2ae29f01bb4e07389a52">connection</a>().close(); });</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 handler thread</span></div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Note: this example creates a connection when the container starts.</span></div>
<div class="line"> <span class="comment">// To create connections after the container has started, use</span></div>
<div class="line"> <span class="comment">// container::connect().</span></div>
<div class="line"> <span class="comment">// See @ref multithreaded_client_flow_control.cpp for an example.</span></div>
<div class="line"> <span class="keywordtype">void</span> <a name="a7"></a><a class="code" href="classproton_1_1messaging__handler.html#a9188622c33638e076d2214080129c824">on_container_start</a>(<a name="_a8"></a><a class="code" href="classproton_1_1container.html">proton::container</a>&amp; cont)<span class="keyword"> override </span>{</div>
<div class="line"> cont.<a name="a9"></a><a class="code" href="classproton_1_1container.html#adbd9ed231804512a47cca3c81f00cdf1">connect</a>(url_);</div>
<div class="line"> }</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#a41277abe0e33a3df2764b08dcc12d768">on_connection_open</a>(<a name="_a11"></a><a class="code" href="classproton_1_1connection.html">proton::connection</a>&amp; conn)<span class="keyword"> override </span>{</div>
<div class="line"> conn.<a name="a12"></a><a class="code" href="classproton_1_1connection.html#ae8eece4fd4b9e1a2531ca12d2ab57a32">open_sender</a>(address_);</div>
<div class="line"> conn.<a name="a13"></a><a class="code" href="classproton_1_1connection.html#aad60d14592ee9d34caca4c61214ecd27">open_receiver</a>(address_);</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordtype">void</span> <a name="a14"></a><a class="code" href="classproton_1_1messaging__handler.html#ac655d56c64574c9eb7b10e80d32764f4">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">// sender_ and work_queue_ must be 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="a15"></a><a class="code" href="classproton_1_1link.html#a7c755d6ac6385e007adb61966598ba63">work_queue</a>();</div>
<div class="line"> sender_ready_.notify_all();</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordtype">void</span> <a name="a16"></a><a class="code" href="classproton_1_1messaging__handler.html#a584c9daeadf4322801f58e054017fecb">on_message</a>(<a name="_a17"></a><a class="code" href="classproton_1_1delivery.html">proton::delivery</a>&amp; dlv, <a class="code" href="classproton_1_1message.html">proton::message</a>&amp; msg)<span class="keyword"> override </span>{</div>
<div class="line"> std::lock_guard&lt;std::mutex&gt; l(lock_);</div>
<div class="line"> messages_.push(msg);</div>
<div class="line"> messages_ready_.notify_all();</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordtype">void</span> <a name="a18"></a><a class="code" href="classproton_1_1messaging__handler.html#a042f595d1807eb1abe0195ab79357edd">on_error</a>(<span class="keyword">const</span> <a name="_a19"></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="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 != 4) {</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; CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT\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="keywordflow">return</span> 1;</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"> </div>
<div class="line"> client cl(url, address);</div>
<div class="line"> <a class="code" href="classproton_1_1container.html">proton::container</a> container(cl);</div>
<div class="line"> std::thread container_thread([&amp;]() { container.run(); });</div>
<div class="line"> </div>
<div class="line"> std::thread sender([&amp;]() {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_messages; ++i) {</div>
<div class="line"> <a class="code" href="classproton_1_1message.html">proton::message</a> msg(<a name="a20"></a><a class="code" href="namespaceproton.html#aa06e1abe8e9c848ba20d89405436fb1f">std::to_string</a>(i + 1));</div>
<div class="line"> cl.send(msg);</div>
<div class="line"> OUT(std::cout &lt;&lt; <span class="stringliteral">&quot;sent \&quot;&quot;</span> &lt;&lt; msg.body() &lt;&lt; <span class="charliteral">&#39;&quot;&#39;</span> &lt;&lt; std::endl);</div>
<div class="line"> }</div>
<div class="line"> });</div>
<div class="line"> </div>
<div class="line"> <span class="keywordtype">int</span> received = 0;</div>
<div class="line"> std::thread receiver([&amp;]() {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n_messages; ++i) {</div>
<div class="line"> <span class="keyword">auto</span> msg = cl.receive();</div>
<div class="line"> OUT(std::cout &lt;&lt; <span class="stringliteral">&quot;received \&quot;&quot;</span> &lt;&lt; msg.body() &lt;&lt; <span class="charliteral">&#39;&quot;&#39;</span> &lt;&lt; std::endl);</div>
<div class="line"> ++received;</div>
<div class="line"> }</div>
<div class="line"> });</div>
<div class="line"> </div>
<div class="line"> sender.join();</div>
<div class="line"> receiver.join();</div>
<div class="line"> cl.close();</div>
<div class="line"> container_thread.join();</div>
<div class="line"> std::cout &lt;&lt; received &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"> </div>
<div class="line"> <span class="keywordflow">return</span> 1;</div>
<div class="line">}</div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclassproton_1_1error__condition_html"><div class="ttname"><a href="classproton_1_1error__condition.html">proton::error_condition</a></div><div class="ttdoc">Describes an endpoint error state.</div><div class="ttdef"><b>Definition:</b> error_condition.hpp:40</div></div>
<div class="ttc" id="amessaging__handler_8hpp_html"><div class="ttname"><a href="messaging__handler_8hpp.html">messaging_handler.hpp</a></div><div class="ttdoc">Handler for Proton messaging events.</div></div>
<div class="ttc" id="amessage_8hpp_html"><div class="ttname"><a href="message_8hpp.html">message.hpp</a></div><div class="ttdoc">An AMQP message.</div></div>
<div class="ttc" id="aclassproton_1_1container_html"><div class="ttname"><a href="classproton_1_1container.html">proton::container</a></div><div class="ttdoc">A top-level container of connections, sessions, and links.</div><div class="ttdef"><b>Definition:</b> container.hpp:50</div></div>
<div class="ttc" id="aclassproton_1_1link_html_aff302bb6016f2ae29f01bb4e07389a52"><div class="ttname"><a href="classproton_1_1link.html#aff302bb6016f2ae29f01bb4e07389a52">proton::link::connection</a></div><div class="ttdeci">class connection connection() const</div><div class="ttdoc">The connection that owns this link.</div></div>
<div class="ttc" id="awork__queue_8hpp_html"><div class="ttname"><a href="work__queue_8hpp.html">work_queue.hpp</a></div><div class="ttdoc">Unsettled API - A context for thread-safe execution of work.</div></div>
<div class="ttc" id="aclassproton_1_1messaging__handler_html_a9188622c33638e076d2214080129c824"><div class="ttname"><a href="classproton_1_1messaging__handler.html#a9188622c33638e076d2214080129c824">proton::messaging_handler::on_container_start</a></div><div class="ttdeci">virtual void on_container_start(container &amp;)</div><div class="ttdoc">The container event loop is starting.</div></div>
<div class="ttc" id="aclassproton_1_1messaging__handler_html_a042f595d1807eb1abe0195ab79357edd"><div class="ttname"><a href="classproton_1_1messaging__handler.html#a042f595d1807eb1abe0195ab79357edd">proton::messaging_handler::on_error</a></div><div class="ttdeci">virtual void on_error(const error_condition &amp;)</div><div class="ttdoc">Fallback error handling.</div></div>
<div class="ttc" id="aclassproton_1_1connection_html"><div class="ttname"><a href="classproton_1_1connection.html">proton::connection</a></div><div class="ttdoc">A connection to a remote AMQP peer.</div><div class="ttdef"><b>Definition:</b> connection.hpp:45</div></div>
<div class="ttc" id="aclassproton_1_1messaging__handler_html_a584c9daeadf4322801f58e054017fecb"><div class="ttname"><a href="classproton_1_1messaging__handler.html#a584c9daeadf4322801f58e054017fecb">proton::messaging_handler::on_message</a></div><div class="ttdeci">virtual void on_message(delivery &amp;, message &amp;)</div><div class="ttdoc">A message is received.</div></div>
<div class="ttc" id="aclassproton_1_1delivery_html"><div class="ttname"><a href="classproton_1_1delivery.html">proton::delivery</a></div><div class="ttdoc">A received message.</div><div class="ttdef"><b>Definition:</b> delivery.hpp:39</div></div>
<div class="ttc" id="anamespaceproton_html_aa06e1abe8e9c848ba20d89405436fb1f"><div class="ttname"><a href="namespaceproton.html#aa06e1abe8e9c848ba20d89405436fb1f">proton::to_string</a></div><div class="ttdeci">std::string to_string(const message &amp;)</div><div class="ttdoc">Human readable string representation.</div></div>
<div class="ttc" id="aconnection_8hpp_html"><div class="ttname"><a href="connection_8hpp.html">connection.hpp</a></div><div class="ttdoc">A connection to a remote AMQP peer.</div></div>
<div class="ttc" id="aclassproton_1_1work__queue_html_a59dae2153455bc095477a3b66a0b681e"><div class="ttname"><a href="classproton_1_1work__queue.html#a59dae2153455bc095477a3b66a0b681e">proton::work_queue::add</a></div><div class="ttdeci">bool add(work fn)</div><div class="ttdoc">Unsettled API - Add work fn to the work queue.</div></div>
<div class="ttc" id="areceiver_8hpp_html"><div class="ttname"><a href="receiver_8hpp.html">receiver.hpp</a></div><div class="ttdoc">A channel for receiving messages.</div></div>
<div class="ttc" id="asender_8hpp_html"><div class="ttname"><a href="sender_8hpp.html">sender.hpp</a></div><div class="ttdoc">A channel for sending messages.</div></div>
<div class="ttc" id="aclassproton_1_1sender_html_a214eb30b24e6831d016a47b9dddda830"><div class="ttname"><a href="classproton_1_1sender.html#a214eb30b24e6831d016a47b9dddda830">proton::sender::send</a></div><div class="ttdeci">tracker send(const message &amp;m)</div><div class="ttdoc">Send a message on the sender.</div></div>
<div class="ttc" id="aclassproton_1_1messaging__handler_html"><div class="ttname"><a href="classproton_1_1messaging__handler.html">proton::messaging_handler</a></div><div class="ttdoc">Handler for Proton messaging events.</div><div class="ttdef"><b>Definition:</b> messaging_handler.hpp:69</div></div>
<div class="ttc" id="aconnection__options_8hpp_html"><div class="ttname"><a href="connection__options_8hpp.html">connection_options.hpp</a></div><div class="ttdoc">Options for creating a connection.</div></div>
<div class="ttc" id="aclassproton_1_1sender_html"><div class="ttname"><a href="classproton_1_1sender.html">proton::sender</a></div><div class="ttdoc">A channel for sending messages.</div><div class="ttdef"><b>Definition:</b> sender.hpp:40</div></div>
<div class="ttc" id="aclassproton_1_1connection_html_aad60d14592ee9d34caca4c61214ecd27"><div class="ttname"><a href="classproton_1_1connection.html#aad60d14592ee9d34caca4c61214ecd27">proton::connection::open_receiver</a></div><div class="ttdeci">receiver open_receiver(const std::string &amp;addr)</div><div class="ttdoc">Open a receiver for addr on default_session().</div></div>
<div class="ttc" id="aclassproton_1_1connection_html_ae8eece4fd4b9e1a2531ca12d2ab57a32"><div class="ttname"><a href="classproton_1_1connection.html#ae8eece4fd4b9e1a2531ca12d2ab57a32">proton::connection::open_sender</a></div><div class="ttdeci">sender open_sender(const std::string &amp;addr)</div><div class="ttdoc">Open a sender for addr on default_session().</div></div>
<div class="ttc" id="aclassproton_1_1link_html_a7c755d6ac6385e007adb61966598ba63"><div class="ttname"><a href="classproton_1_1link.html#a7c755d6ac6385e007adb61966598ba63">proton::link::work_queue</a></div><div class="ttdeci">class work_queue &amp; work_queue() const</div><div class="ttdoc">Get the work_queue for the link.</div></div>
<div class="ttc" id="aclassproton_1_1messaging__handler_html_ac655d56c64574c9eb7b10e80d32764f4"><div class="ttname"><a href="classproton_1_1messaging__handler.html#ac655d56c64574c9eb7b10e80d32764f4">proton::messaging_handler::on_sender_open</a></div><div class="ttdeci">virtual void on_sender_open(sender &amp;)</div><div class="ttdoc">The remote peer opened the link.</div></div>
<div class="ttc" id="acontainer_8hpp_html"><div class="ttname"><a href="container_8hpp.html">container.hpp</a></div><div class="ttdoc">A top-level container of connections, sessions, and links.</div></div>
<div class="ttc" id="aclassproton_1_1container_html_adbd9ed231804512a47cca3c81f00cdf1"><div class="ttname"><a href="classproton_1_1container.html#adbd9ed231804512a47cca3c81f00cdf1">proton::container::connect</a></div><div class="ttdeci">returned&lt; connection &gt; connect(const std::string &amp;conn_url, const connection_options &amp;conn_opts)</div><div class="ttdoc">Connect to conn_url and send an open request to the remote peer.</div></div>
<div class="ttc" id="aclassproton_1_1messaging__handler_html_a41277abe0e33a3df2764b08dcc12d768"><div class="ttname"><a href="classproton_1_1messaging__handler.html#a41277abe0e33a3df2764b08dcc12d768">proton::messaging_handler::on_connection_open</a></div><div class="ttdeci">virtual void on_connection_open(connection &amp;)</div><div class="ttdoc">The remote peer opened the connection: called once on initial open, and again on each successful auto...</div></div>
<div class="ttc" id="aclassproton_1_1message_html"><div class="ttname"><a href="classproton_1_1message.html">proton::message</a></div><div class="ttdoc">An AMQP message.</div><div class="ttdef"><b>Definition:</b> message.hpp:50</div></div>
<div class="ttc" id="aclassproton_1_1work__queue_html"><div class="ttname"><a href="classproton_1_1work__queue.html">proton::work_queue</a></div><div class="ttdoc">Unsettled API - A context for thread-safe execution of work.</div><div class="ttdef"><b>Definition:</b> work_queue.hpp:339</div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
</ul>
</div>
</body>
</html>