1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
|
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>qpid::client::Connection Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="90%" align="center">
<tr>
<td align="left">
<a title="Apache Qpid Project Page" href="http://qpid.apache.org">Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET</a>
</td>
<td align="right">
<a title="Apache Qpid Documentation" href="http://qpid.apache.org/documentation.html">Apache Qpid Documentation</a>
</td>
</tr>
</table>
<!-- Generated by Doxygen 1.7.5 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="a00574.html">qpid</a> </li>
<li class="navelem"><a class="el" href="a00576.html">client</a> </li>
<li class="navelem"><a class="el" href="a00058.html">Connection</a> </li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-attribs">Protected Attributes</a> </div>
<div class="headertitle">
<div class="title">qpid::client::Connection Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="qpid::client::Connection" -->
<p>Represents a connection to an AMQP broker.
<a href="a00058.html#details">More...</a></p>
<p><code>#include <<a class="el" href="a00462_source.html">qpid/client/Connection.h</a>></code></p>
<p><a href="a00678.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#aeb63c0b8163dbdd2261e8b0ba8f93bf8">Connection</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="a00058.html" title="Represents a connection to an AMQP broker.">Connection</a> object, but does not open the connection. <a href="#aeb63c0b8163dbdd2261e8b0ba8f93bf8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#ac26788d92d97cd8f588337b59461b636">~Connection</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroys a <a class="el" href="a00058.html" title="Represents a connection to an AMQP broker.">Connection</a> object but does not close the connection if it was open. <a href="#ac26788d92d97cd8f588337b59461b636"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#a452b2601c2c69aff8eb8d5ffbdd796a7">open</a> (const <a class="el" href="a00345.html">std::string</a> &host, int port=5672, const <a class="el" href="a00345.html">std::string</a> &uid="", const <a class="el" href="a00345.html">std::string</a> &pwd="", const <a class="el" href="a00345.html">std::string</a> &virtualhost="/", <a class="el" href="a00556.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> maxFrameSize=65535)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a connection to a broker. <a href="#a452b2601c2c69aff8eb8d5ffbdd796a7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#ac91ebd9f480df875611d99f62786dd0d">open</a> (const <a class="el" href="a00373.html">Url</a> &url, const <a class="el" href="a00345.html">std::string</a> &uid="", const <a class="el" href="a00345.html">std::string</a> &pwd="", const <a class="el" href="a00345.html">std::string</a> &virtualhost="/", <a class="el" href="a00556.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> maxFrameSize=65535)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a connection to a broker using a URL. <a href="#ac91ebd9f480df875611d99f62786dd0d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#a7970fb2ce8f726611a680f0f3679c482">open</a> (const <a class="el" href="a00373.html">Url</a> &url, const <a class="el" href="a00065.html">ConnectionSettings</a> &settings)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a connection to a broker using a URL. <a href="#a7970fb2ce8f726611a680f0f3679c482"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#a2f84de4cffe33719112928f76499dac8">open</a> (const <a class="el" href="a00065.html">ConnectionSettings</a> &settings)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a connection to a broker. <a href="#a2f84de4cffe33719112928f76499dac8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#ac9a4e6f3bd3d211485ded041d496beb0">close</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Close the connection. <a href="#ac9a4e6f3bd3d211485ded041d496beb0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00576.html#aa15500ce0ba4cea17f4226bebe584a67">Session</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#ad6034d5dc2dc5d556523fc7e3b3dd3c2">newSession</a> (const <a class="el" href="a00345.html">std::string</a> &name=<a class="el" href="a00345.html">std::string</a>(), <a class="el" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> timeoutSeconds=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new session on this connection. <a href="#ad6034d5dc2dc5d556523fc7e3b3dd3c2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#ae73debd72b4b2742a521c3ef87183a8c">resume</a> (<a class="el" href="a00576.html#aa15500ce0ba4cea17f4226bebe584a67">Session</a> &session)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Resume a suspended session. <a href="#ae73debd72b4b2742a521c3ef87183a8c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#acaa3a536f76df0ea7b816e82fa9adaab">isOpen</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00386.html">std::vector</a>< <a class="el" href="a00373.html">Url</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#a71da3a028dab692000f60995888e61de">getInitialBrokers</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">In a cluster, returns the initial set of known broker URLs at the time of connection. <a href="#a71da3a028dab692000f60995888e61de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#ab044f297d8e236c8c253e7a8d14c050f">registerFailureCallback</a> (boost::function< void()> fn)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00065.html">ConnectionSettings</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#a0d63e6aa8f889c0617dfa51762d18bab">getNegotiatedSettings</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the set of client negotiated settings. <a href="#a0d63e6aa8f889c0617dfa51762d18bab"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boost::shared_ptr< ConnectionImpl > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00058.html#a22f98c94ca727ab34557471c1e4b8d63">impl</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Represents a connection to an AMQP broker. </p>
<p>All communication is initiated by establishing a connection, then creating one or more Session objects using the connection. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00058.html#ad6034d5dc2dc5d556523fc7e3b3dd3c2" title="Create a new session on this connection.">newSession()</a></dd></dl>
<p>Some methods use an AMQP 0-10 URL to specify connection parameters. This is defined in the AMQP 0-10 specification (<a href="http://jira.amqp.org/confluence/display/AMQP/AMQP+Specification">http://jira.amqp.org/confluence/display/AMQP/AMQP+Specification</a>).</p>
<p>amqp_url = "amqp:" prot_addr_list prot_addr_list = [prot_addr ","]* prot_addr prot_addr = tcp_prot_addr | tls_prot_addr</p>
<p>tcp_prot_addr = tcp_id tcp_addr tcp_id = "tcp:" | "" tcp_addr = [host [":" port] ] host = <as per <a href="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a>> port = number]]> </p>
</div><hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="aeb63c0b8163dbdd2261e8b0ba8f93bf8"></a><!-- doxytag: member="qpid::client::Connection::Connection" ref="aeb63c0b8163dbdd2261e8b0ba8f93bf8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qpid::client::Connection::Connection </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a <a class="el" href="a00058.html" title="Represents a connection to an AMQP broker.">Connection</a> object, but does not open the connection. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00058.html#a452b2601c2c69aff8eb8d5ffbdd796a7" title="Opens a connection to a broker.">open()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ac26788d92d97cd8f588337b59461b636"></a><!-- doxytag: member="qpid::client::Connection::~Connection" ref="ac26788d92d97cd8f588337b59461b636" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qpid::client::Connection::~Connection </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destroys a <a class="el" href="a00058.html" title="Represents a connection to an AMQP broker.">Connection</a> object but does not close the connection if it was open. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00058.html#ac9a4e6f3bd3d211485ded041d496beb0" title="Close the connection.">close()</a> </dd></dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac9a4e6f3bd3d211485ded041d496beb0"></a><!-- doxytag: member="qpid::client::Connection::close" ref="ac9a4e6f3bd3d211485ded041d496beb0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Close the connection. </p>
<p>Any further use of this connection (without reopening it) will not succeed. </p>
</div>
</div>
<a class="anchor" id="a71da3a028dab692000f60995888e61de"></a><!-- doxytag: member="qpid::client::Connection::getInitialBrokers" ref="a71da3a028dab692000f60995888e61de" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00386.html">std::vector</a><<a class="el" href="a00373.html">Url</a>> qpid::client::Connection::getInitialBrokers </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>In a cluster, returns the initial set of known broker URLs at the time of connection. </p>
</div>
</div>
<a class="anchor" id="a0d63e6aa8f889c0617dfa51762d18bab"></a><!-- doxytag: member="qpid::client::Connection::getNegotiatedSettings" ref="a0d63e6aa8f889c0617dfa51762d18bab" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="a00065.html">ConnectionSettings</a>& qpid::client::Connection::getNegotiatedSettings </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the set of client negotiated settings. </p>
</div>
</div>
<a class="anchor" id="acaa3a536f76df0ea7b816e82fa9adaab"></a><!-- doxytag: member="qpid::client::Connection::isOpen" ref="acaa3a536f76df0ea7b816e82fa9adaab" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool qpid::client::Connection::isOpen </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ad6034d5dc2dc5d556523fc7e3b3dd3c2"></a><!-- doxytag: member="qpid::client::Connection::newSession" ref="ad6034d5dc2dc5d556523fc7e3b3dd3c2" args="(const std::string &name=std::string(), uint32_t timeoutSeconds=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00576.html#aa15500ce0ba4cea17f4226bebe584a67">Session</a> qpid::client::Connection::newSession </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>name</em> = <code><a class="el" href="a00345.html">std::string</a>()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> </td>
<td class="paramname"><em>timeoutSeconds</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a new session on this connection. </p>
<p>Sessions allow multiple streams of work to be multiplexed over the same connection. The returned Session provides functions to send commands to the broker.</p>
<p>Session functions are synchronous. In other words, a Session function will send a command to the broker and does not return until it receives the broker's response confirming the command was executed.</p>
<p>AsyncSession provides asynchronous versions of the same functions. These functions send a command to the broker but do not wait for a response.</p>
<p>You can convert a Session s into an AsyncSession as follows: </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <<a class="code" href="a00457.html">qpid/client/AsyncSession.h</a>></span>
<a class="code" href="a00576.html#aaa363d2dd092eb7f790126a8f9333c8c" title="AsyncSession is an alias for Session_0_10.">AsyncSession</a> as = <a class="code" href="a00576.html#aa25c80caf55dd39a2e1d5141916866e7" title="Conversion to AsyncSession_0_10 from another session type.">async</a>(s);
</pre></div><p>You can execute a single command asynchronously will a Session s like ths: </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="a00576.html#aa25c80caf55dd39a2e1d5141916866e7" title="Conversion to AsyncSession_0_10 from another session type.">async</a>(s).messageTransfer(...);
</pre></div><p>Using an AsyncSession is faster for sending large numbers of commands, since each command is sent as soon as possible without waiting for the previous command to be confirmed.</p>
<p>However with AsyncSession you cannot assume that a command has completed until you explicitly synchronize. The simplest way to do this is to call <a class="el" href="a00328.html#a198880ec0840c18b0d8a9140d38db699" title="Synchronize the session: sync() waits until all commands issued on this session so far have been comp...">Session::sync()</a> or <a class="el" href="a00328.html#a198880ec0840c18b0d8a9140d38db699" title="Synchronize the session: sync() waits until all commands issued on this session so far have been comp...">AsyncSession::sync()</a>. Both of these functions wait for the broker to confirm all commands issued so far on the session.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">name,:</td><td>A name to identify the session. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00333.html" title="Identifier for a session.">qpid::SessionId</a> If the name is empty (the default) then a unique name will be chosen using a Universally-unique identifier (UUID) algorithm. </dd></dl>
</div>
</div>
<a class="anchor" id="a452b2601c2c69aff8eb8d5ffbdd796a7"></a><!-- doxytag: member="qpid::client::Connection::open" ref="a452b2601c2c69aff8eb8d5ffbdd796a7" args="(const std::string &host, int port=5672, const std::string &uid="", const std::string &pwd="", const std::string &virtualhost="/", uint16_t maxFrameSize=65535)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::open </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>host</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>port</em> = <code>5672</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>uid</em> = <code>""</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>pwd</em> = <code>""</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>virtualhost</em> = <code>"/"</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00556.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> </td>
<td class="paramname"><em>maxFrameSize</em> = <code>65535</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Opens a connection to a broker. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">host</td><td>the host on which the broker is running.</td></tr>
<tr><td class="paramname">port</td><td>the port on the which the broker is listening.</td></tr>
<tr><td class="paramname">uid</td><td>the userid to connect with.</td></tr>
<tr><td class="paramname">pwd</td><td>the password to connect with (currently SASL PLAIN is the only authentication method supported so this is sent in clear text).</td></tr>
<tr><td class="paramname">virtualhost</td><td>the AMQP virtual host to use (virtual hosts, where implemented(!), provide namespace partitioning within a single broker). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ac91ebd9f480df875611d99f62786dd0d"></a><!-- doxytag: member="qpid::client::Connection::open" ref="ac91ebd9f480df875611d99f62786dd0d" args="(const Url &url, const std::string &uid="", const std::string &pwd="", const std::string &virtualhost="/", uint16_t maxFrameSize=65535)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::open </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a00373.html">Url</a> & </td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>uid</em> = <code>""</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>pwd</em> = <code>""</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00345.html">std::string</a> & </td>
<td class="paramname"><em>virtualhost</em> = <code>"/"</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00556.html#a273cf69d639a59973b6019625df33e30">uint16_t</a> </td>
<td class="paramname"><em>maxFrameSize</em> = <code>65535</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Opens a connection to a broker using a URL. </p>
<p>If the URL contains multiple addresses, try each in turn till connection is successful.</p>
<p>address of the broker to connect to.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">uid</td><td>the userid to connect with.</td></tr>
<tr><td class="paramname">pwd</td><td>the password to connect with (currently SASL PLAIN is the only authentication method supported so this is sent in clear text).</td></tr>
<tr><td class="paramname">virtualhost</td><td>the AMQP virtual host to use (virtual hosts, where implemented(!), provide namespace partitioning within a single broker). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a7970fb2ce8f726611a680f0f3679c482"></a><!-- doxytag: member="qpid::client::Connection::open" ref="a7970fb2ce8f726611a680f0f3679c482" args="(const Url &url, const ConnectionSettings &settings)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::open </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a00373.html">Url</a> & </td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="a00065.html">ConnectionSettings</a> & </td>
<td class="paramname"><em>settings</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Opens a connection to a broker using a URL. </p>
<p>If the URL contains multiple addresses, try each in turn till connection is successful.</p>
<p>address of the broker to connect to.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">settings</td><td>used for any settings not provided by the URL. Settings provided by the url (e.g. host, port) are ignored. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a2f84de4cffe33719112928f76499dac8"></a><!-- doxytag: member="qpid::client::Connection::open" ref="a2f84de4cffe33719112928f76499dac8" args="(const ConnectionSettings &settings)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::open </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a00065.html">ConnectionSettings</a> & </td>
<td class="paramname"><em>settings</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Opens a connection to a broker. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">the</td><td>settings to use (host, port etc). </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00065.html" title="Settings for a Connection.">ConnectionSettings</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ab044f297d8e236c8c253e7a8d14c050f"></a><!-- doxytag: member="qpid::client::Connection::registerFailureCallback" ref="ab044f297d8e236c8c253e7a8d14c050f" args="(boost::function< void()> fn)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::registerFailureCallback </td>
<td>(</td>
<td class="paramtype">boost::function< void()> </td>
<td class="paramname"><em>fn</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ae73debd72b4b2742a521c3ef87183a8c"></a><!-- doxytag: member="qpid::client::Connection::resume" ref="ae73debd72b4b2742a521c3ef87183a8c" args="(Session &session)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void qpid::client::Connection::resume </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00576.html#aa15500ce0ba4cea17f4226bebe584a67">Session</a> & </td>
<td class="paramname"><em>session</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resume a suspended session. </p>
<p>A session may be resumed on a different connection to the one that created it. </p>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a22f98c94ca727ab34557471c1e4b8d63"></a><!-- doxytag: member="qpid::client::Connection::impl" ref="a22f98c94ca727ab34557471c1e4b8d63" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boost::shared_ptr<ConnectionImpl> <a class="el" href="a00058.html#a22f98c94ca727ab34557471c1e4b8d63">qpid::client::Connection::impl</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="a00462_source.html#l00071">71</a> of file <a class="el" href="a00462_source.html">Connection.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>qpid/client/<a class="el" href="a00462_source.html">Connection.h</a></li>
</ul>
</div>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<hr size="1">
<address style="text-align: left;"><small>
Qpid C++ API Reference</small></address>
<address style="text-align: right;">
<small>
Generated on Thu May 10 2012 for Qpid C++ Client API by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.5</small>
</address>
</body>
</html>
|