summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connection.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-10-09 19:36:51 +0000
committerAlan Conway <aconway@apache.org>2008-10-09 19:36:51 +0000
commitd6901e52ab3ee9c40eddc4ad3b4787127c36d874 (patch)
tree85b9ba2e0d0922be150480392ec1b706a6df5cd0 /cpp/src/qpid/client/Connection.cpp
parent016ae5acebab0eaf6dd70f5d4d653fdfee93925d (diff)
downloadqpid-python-d6901e52ab3ee9c40eddc4ad3b4787127c36d874.tar.gz
Client-side support for amq.faiover exchange. Connection::getKnownBrokers provides latest list.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@703237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Connection.cpp')
-rw-r--r--cpp/src/qpid/client/Connection.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp
index b8b4f9ccf3..27706fab8c 100644
--- a/cpp/src/qpid/client/Connection.cpp
+++ b/cpp/src/qpid/client/Connection.cpp
@@ -44,7 +44,7 @@ using namespace qpid::sys;
namespace qpid {
namespace client {
-Connection::Connection() : channelIdCounter(0), version(framing::highestProtocolVersion) {}
+Connection::Connection() : version(framing::highestProtocolVersion) {}
Connection::~Connection(){ }
@@ -106,26 +106,19 @@ void Connection::open(const ConnectionSettings& settings)
impl = shared_ptr<ConnectionImpl>(new ConnectionImpl(version, settings));
impl->open();
- max_frame_size = impl->getNegotiatedSettings().maxFrameSize;
}
-Session Connection::newSession(const std::string& name) {
+Session Connection::newSession(const std::string& name, uint32_t timeout) {
if (!isOpen())
throw Exception(QPID_MSG("Connection has not yet been opened"));
- shared_ptr<SessionImpl> simpl(
- new SessionImpl(name, impl, ++channelIdCounter, max_frame_size));
- impl->addSession(simpl);
- simpl->open(0);
Session s;
- SessionBase_0_10Access(s).set(simpl);
+ SessionBase_0_10Access(s).set(impl->newSession(name, timeout));
return s;
}
void Connection::resume(Session& session) {
if (!isOpen())
throw Exception(QPID_MSG("Connection is not open."));
-
- session.impl->setChannel(++channelIdCounter);
impl->addSession(session.impl);
session.impl->resume(impl);
}
@@ -134,4 +127,8 @@ void Connection::close() {
impl->close();
}
+std::vector<Url> Connection::getKnownBrokers() {
+ return isOpen() ? impl->getKnownBrokers() : std::vector<Url>();
+}
+
}} // namespace qpid::client