diff options
author | Alan Conway <aconway@apache.org> | 2008-05-26 18:10:05 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-05-26 18:10:05 +0000 |
commit | ce7678789fe3e8c5caebb59a26aa418fbb95e5d3 (patch) | |
tree | affd8e2de460cba285e7c25e15f5c3d94444f905 /cpp/src/qpid/client/Connection.cpp | |
parent | 0b56077cbb8b6e9cdd982cbdeaa3ec6fe1bd5434 (diff) | |
download | qpid-python-ce7678789fe3e8c5caebb59a26aa418fbb95e5d3.tar.gz |
Changes to Session API:
- Session is synchronous, no futures.
- AsyncSession is async, returns futures.
- Conversion functions sync(s) async(s) return a sync/async view of session s.
- Connection::newSession - takes name, no timeout
- SessionBase::getId - returns SessionId not UUID.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@660258 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Connection.cpp')
-rw-r--r-- | cpp/src/qpid/client/Connection.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp index 82d1eac8b4..bec2b0345d 100644 --- a/cpp/src/qpid/client/Connection.cpp +++ b/cpp/src/qpid/client/Connection.cpp @@ -22,6 +22,7 @@ #include "ConnectionSettings.h" #include "Message.h" #include "SessionImpl.h" +#include "SessionBase_0_10Access.h" #include "qpid/log/Logger.h" #include "qpid/log/Options.h" #include "qpid/log/Statement.h" @@ -72,18 +73,16 @@ void Connection::open(const ConnectionSettings& settings) max_frame_size = impl->getNegotiatedSettings().maxFrameSize; } -Session Connection::newSession(SynchronousMode sync, - uint32_t detachedLifetime) -{ +Session Connection::newSession(const std::string& name) { if (!impl) throw Exception(QPID_MSG("Connection has not yet been opened")); - - shared_ptr<SessionImpl> core( - new SessionImpl(impl, ++channelIdCounter, max_frame_size)); - core->setSync(sync); - impl->addSession(core); - core->open(detachedLifetime); - return Session(core); + 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); + return s; } void Connection::resume(Session& session) { |