#include <Connection.h>
Public Member Functions | |
Connection (framing::ProtocolVersion=framing::highestProtocolVersion) | |
Creates a connection object, but does not open the connection. | |
void | open (const std::string &host, int port=5672, const std::string &uid="guest", const std::string &pwd="guest", const std::string &virtualhost="/", uint16_t maxFrameSize=65535) |
Opens a connection to a broker. | |
void | open (const ConnectionSettings &settings) |
Opens a connection to a broker. | |
void | close () |
Close the connection. | |
void | openChannel (Channel &) |
Associate a Channel with this connection and open it for use. | |
Session | newSession (SynchronousMode sync, uint32_t detachedLifetime=0) |
Create a new session on this connection. | |
void | resume (Session &session) |
Resume a suspended session. | |
Protected Attributes | |
boost::shared_ptr< ConnectionImpl > | impl |
All communication is initiated by establishing a connection, then opening one or more Channels over that connection.
qpid::client::Connection::Connection | ( | framing::ProtocolVersion | = framing::highestProtocolVersion |
) |
Creates a connection object, but does not open the connection.
_version | the version of the protocol to connect with. |
void qpid::client::Connection::open | ( | const std::string & | host, | |
int | port = 5672 , |
|||
const std::string & | uid = "guest" , |
|||
const std::string & | pwd = "guest" , |
|||
const std::string & | virtualhost = "/" , |
|||
uint16_t | maxFrameSize = 65535 | |||
) |
Opens a connection to a broker.
host | the host on which the broker is running. | |
port | the port on the which the broker is listening. | |
uid | the userid to connect with. | |
pwd | the password to connect with (currently SASL PLAIN is the only authentication method supported so this is sent in clear text). | |
virtualhost | the AMQP virtual host to use (virtual hosts, where implemented(!), provide namespace partitioning within a single broker). |
Referenced by BrokerFixture::open().
void qpid::client::Connection::open | ( | const ConnectionSettings & | settings | ) |
Opens a connection to a broker.
the | settings to use (host, port etc) |
void qpid::client::Connection::close | ( | ) |
Close the connection.
Any further use of this connection (without reopening it) will not succeed.
void qpid::client::Connection::openChannel | ( | Channel & | ) |
Associate a Channel with this connection and open it for use.
In AMQP, channels are like multiplexed 'sessions' of work over a connection. Almost all the interaction with AMQP is done over a channel.
connection | the connection object to be associated with the channel. Call Channel::close() to close the channel. |
Session qpid::client::Connection::newSession | ( | SynchronousMode | sync, | |
uint32_t | detachedLifetime = 0 | |||
) |
Create a new session on this connection.
Sessions allow multiple streams of work to be multiplexed over the same connection.
detachedLifetime,: | A session may be detached from its channel, either by calling Session::suspend() or because of a network failure. The session state is preserved for detachedLifetime seconds to allow a call to resume(). After that the broker may discard the session state. Default is 0, meaning the session cannot be resumed. |
void qpid::client::Connection::resume | ( | Session & | session | ) |
Resume a suspended session.
A session may be resumed on a different connection to the one that created it.