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.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp
index cef076527f..2d8cbb2ddb 100644
--- a/cpp/src/qpid/client/Connection.cpp
+++ b/cpp/src/qpid/client/Connection.cpp
@@ -25,7 +25,7 @@
#include "Connection.h"
#include "Channel.h"
#include "Message.h"
-#include "ScopedAssociation.h"
+#include "SessionCore.h"
#include "qpid/log/Logger.h"
#include "qpid/log/Options.h"
#include "qpid/log/Statement.h"
@@ -70,16 +70,22 @@ void Connection::openChannel(Channel& channel) {
channel.open(newSession());
}
-Session Connection::newSession() {
- ChannelId id = ++channelIdCounter;
- SessionCore::shared_ptr session(new SessionCore(id, impl, max_frame_size));
- ScopedAssociation::shared_ptr assoc(new ScopedAssociation(session, impl));
- session->open();
- return Session(assoc);
+Session Connection::newSession(uint32_t detachedLifetime) {
+ shared_ptr<SessionCore> core(
+ new SessionCore(*impl, ++channelIdCounter, max_frame_size));
+ impl->addSession(core);
+ core->open(detachedLifetime);
+ return Session(core);
}
-void Connection::close()
-{
+void Connection::resume(Session& session) {
+ shared_ptr<SessionCore> core=session.impl;
+ core->setChannel(++channelIdCounter);
+ impl->addSession(core);
+ core->resume(*impl);
+}
+
+void Connection::close() {
impl->close();
}