summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connection.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-09-28 16:21:34 +0000
committerAlan Conway <aconway@apache.org>2007-09-28 16:21:34 +0000
commit8b82aef0397d65de0c7278476e4f409fcc636306 (patch)
treea25d9bbb01203335bc1450a5e5ed0c29074913ae /cpp/src/qpid/client/Connection.cpp
parentf689c47486b4cfc7655e37da2b232fe27be1cc42 (diff)
downloadqpid-python-8b82aef0397d65de0c7278476e4f409fcc636306.tar.gz
* src/tests/ClientSessionTest.cpp: Suspend/resume tests.
* broker/SessionManager.cpp, broker/SessionHandler.cpp: Implement suspend/resume * client/ScopedAssociation.h, SessionCore.h, SessionHandler.h: Simplified relationships. - Removed ScopedAssociation. - SessionHandler: is now a member of SessionCore. - SessionCore: shared_ptr ownership by Session(s) and ConnectionImpl. - Using framing::FrameHandler interfaces. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580403 13f79535-47bb-0310-9956-ffa450edef68
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();
}