#include <Connection.h>
Inheritance diagram for qpid::client::Connection:
Public Member Functions | |
Connection (bool debug=false, uint32_t max_frame_size=65536, 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="/") |
Opens a connection to a broker. | |
void | close (framing::ReplyCode=200, const std::string &msg=OK, framing::ClassId=0, framing::MethodId=0) |
Close the connection with optional error information for the peer. | |
void | openChannel (Channel &) |
Associate a Channel with this connection and open it for use. | |
void | send (framing::AMQFrame *) |
void | received (framing::AMQFrame *) |
void | idleOut () |
void | idleIn () |
void | shutdown () |
void | setConnector (Connector &connector) |
uint32_t | getMaxFrameSize () |
framing::ProtocolVersion | getVersion () const |
All communication is initiated by establishing a connection, then opening one or more Channels over that connection.
qpid::client::Connection::Connection | ( | bool | debug = false , |
|
uint32_t | max_frame_size = 65536 , |
|||
framing::ProtocolVersion | = 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::close | ( | framing::ReplyCode | = 200 , |
|
const std::string & | msg = OK , |
|||
framing::ClassId | = 0 , |
|||
framing::MethodId | = 0 | |||
) |
Close the connection with optional error information for the peer.
Any further use of this connection (without reopening it) will not succeed.
uint32_t qpid::client::Connection::getMaxFrameSize | ( | ) | [inline] |
framing::ProtocolVersion qpid::client::Connection::getVersion | ( | ) | const [inline] |
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::openChannel | ( | Channel & | ) |
Associate a Channel with this connection and open it for use.
In AMQP channels are like multi-plexed '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. |