#include <Connection.h>
Public Member Functions | |
Connection (bool debug=false, u_int32_t max_frame_size=65536, qpid::framing::ProtocolVersion *_version=&(qpid::framing::highestProtocolVersion)) | |
Creates a connection object, but does not open the connection. | |
void | setTcpNoDelay (bool on) |
void | open (const std::string &host, int port=5672, const std::string &uid="guest", const std::string &pwd="guest", const std::string &virtualhost="") |
Opens a connection to a broker. | |
void | close () |
Closes the connection. | |
void | openChannel (Channel *channel) |
Opens a Channel. | |
void | closeChannel (Channel *channel) |
void | removeChannel (Channel *channel) |
virtual void | received (qpid::framing::AMQFrame *frame) |
virtual void | idleOut () |
virtual void | idleIn () |
virtual void | shutdown () |
u_int32_t | getMaxFrameSize () |
|
All communication is initiated by establishing a connection, then opening one or more Channels over that connection.
qpid::client::Connection::Connection | ( | bool | debug = false , |
|
u_int32_t | max_frame_size = 65536 , |
|||
qpid::framing::ProtocolVersion * | _version = &(qpid::framing::highestProtocolVersion) | |||
) |
Creates a connection object, but does not open the connection.
_version | the version of the protocol to connect with | |
debug | turns on tracing for the connection (i.e. prints details of the frames sent and received to std out). Optional and defaults to false. | |
max_frame_size | the maximum frame size that the client will accept. Optional and defaults to 65536. |
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 = "" | |||
) |
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). |
void qpid::client::Connection::close | ( | ) |
Closes the connection.
Any further use of this connection (without reopening it) will not succeed.
void qpid::client::Connection::openChannel | ( | Channel * | channel | ) |
Opens a Channel.
In AMQP channels are like multi-plexed 'sessions' of work over a connection. Almost all the interaction with AMQP is done over a channel.
channel | a pointer to a channel instance that will be used to represent the new channel. |