From 8b82aef0397d65de0c7278476e4f409fcc636306 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 28 Sep 2007 16:21:34 +0000 Subject: * 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 --- cpp/src/qpid/client/Connection.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'cpp/src/qpid/client/Connection.cpp') 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 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 core=session.impl; + core->setChannel(++channelIdCounter); + impl->addSession(core); + core->resume(*impl); +} + +void Connection::close() { impl->close(); } -- cgit v1.2.1