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

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

#include <Connection.h>

Inheritance diagram for qpid::client::Connection:

Inheritance graph
[legend]
Collaboration diagram for qpid::client::Connection:

Collaboration graph
[legend]
List of all members.

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

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,
uint32_t  max_frame_size = 65536,
framing::ProtocolVersion  = 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::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]

Returns:
the maximum frame size in use on this connection

framing::ProtocolVersion qpid::client::Connection::getVersion (  )  const [inline]

Returns:
protocol version in use on this connection.

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

Parameters:
connection the connection object to be associated with the channel. Call Channel::close() to close the channel.


The documentation for this class was generated from the following file:
Generated on Tue Apr 17 14:22:17 2007 for Qpid by  doxygen 1.4.7