summaryrefslogtreecommitdiff
path: root/cpp/lib/client
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/lib/client')
-rw-r--r--cpp/lib/client/ClientChannel.h2
-rw-r--r--cpp/lib/client/Connection.cpp8
-rw-r--r--cpp/lib/client/Connection.h6
3 files changed, 9 insertions, 7 deletions
diff --git a/cpp/lib/client/ClientChannel.h b/cpp/lib/client/ClientChannel.h
index 27509a10d9..066f837430 100644
--- a/cpp/lib/client/ClientChannel.h
+++ b/cpp/lib/client/ClientChannel.h
@@ -92,7 +92,7 @@ namespace client {
u_int16_t prefetch;
const bool transactional;
- qpid::framing::ProtocolVersion version;
+ qpid::framing::ProtocolVersion version;
void enqueue();
void retrieve(Message& msg);
diff --git a/cpp/lib/client/Connection.cpp b/cpp/lib/client/Connection.cpp
index 9c81192573..78aeafb37b 100644
--- a/cpp/lib/client/Connection.cpp
+++ b/cpp/lib/client/Connection.cpp
@@ -32,10 +32,8 @@ using namespace qpid::sys;
u_int16_t Connection::channelIdCounter;
-Connection::Connection(bool debug, u_int32_t _max_frame_size) : max_frame_size(_max_frame_size), closed(true),
-// AMQP version management change - kpvdr 2006-11-20
-// TODO: Make this class version-aware and link these hard-wired numbers to that version
- version(8, 0)
+Connection::Connection( bool debug, u_int32_t _max_frame_size, qpid::framing::ProtocolVersion* _version) : max_frame_size(_max_frame_size), closed(true),
+ version(_version->getMajor(),_version->getMinor())
{
connector = new Connector(debug, _max_frame_size);
}
@@ -53,7 +51,7 @@ void Connection::open(const std::string& _host, int _port, const std::string& ui
out = connector->getOutputHandler();
connector->connect(host, port);
- ProtocolInitiation* header = new ProtocolInitiation(8, 0);
+ ProtocolInitiation* header = new ProtocolInitiation(version);
responses.expect();
connector->init(header);
responses.receive(method_bodies.connection_start);
diff --git a/cpp/lib/client/Connection.h b/cpp/lib/client/Connection.h
index 7d3f1a1446..3de9b6bf31 100644
--- a/cpp/lib/client/Connection.h
+++ b/cpp/lib/client/Connection.h
@@ -38,6 +38,7 @@
#include <ResponseHandler.h>
namespace qpid {
+
/**
* The client namespace contains all classes that make up a client
* implementation of the AMQP protocol. The key classes that form
@@ -93,6 +94,8 @@ namespace client {
* Creates a connection object, but does not open the
* connection.
*
+ * @param _version the version of the protocol to connect with
+ *
* @param 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.
@@ -100,7 +103,8 @@ namespace client {
* @param max_frame_size the maximum frame size that the
* client will accept. Optional and defaults to 65536.
*/
- Connection(bool debug = false, u_int32_t max_frame_size = 65536);
+ Connection( bool debug = false, u_int32_t max_frame_size = 65536,
+ qpid::framing::ProtocolVersion* _version = &(qpid::framing::highestVersion));
~Connection();
/**