qpid::client::Connection Class Reference
[Application API for an AMQP client]

Represents a connection to an AMQP broker. More...

#include <Connection.h>

List of all members.

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 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 ()
 
Returns:
the maximum frame size in use on this connection


Detailed Description

Represents a connection to an AMQP broker.

All communication is initiated by establishing a connection, then opening one or more Channels over that connection.


Constructor & Destructor Documentation

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.

Parameters:
_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.


Member Function Documentation

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.

Parameters:
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.

Parameters:
channel a pointer to a channel instance that will be used to represent the new channel.


The documentation for this class was generated from the following file:
Generated on Thu Jan 25 11:48:16 2007 for Qpid by  doxygen 1.5.1