summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connection.cpp
diff options
context:
space:
mode:
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