diff options
| author | Gordon Sim <gsim@apache.org> | 2009-11-17 17:34:55 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-11-17 17:34:55 +0000 |
| commit | 99c896bf60506c66f339d2ce51d4dca2725968af (patch) | |
| tree | 5658e1d6c3ad6adfb2823dbbabefa5b66c951274 /cpp/src/qpid/client/amqp0_10/ConnectionImpl.h | |
| parent | 054f31c5dd081bf0476ac8cc4db4ece722a465a5 (diff) | |
| download | qpid-python-99c896bf60506c66f339d2ce51d4dca2725968af.tar.gz | |
QPID-664: Allow application to set session name and retrieve session using that name; close all sessions when connection is closed.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@881394 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/amqp0_10/ConnectionImpl.h')
| -rw-r--r-- | cpp/src/qpid/client/amqp0_10/ConnectionImpl.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h index a8754778f0..5272121f92 100644 --- a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h +++ b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h @@ -29,7 +29,7 @@ #include "qpid/client/ConnectionSettings.h" #include "qpid/sys/Mutex.h" #include "qpid/sys/Semaphore.h" -#include <vector> +#include <map> namespace qpid { namespace client { @@ -42,13 +42,14 @@ class ConnectionImpl : public qpid::messaging::ConnectionImpl public: ConnectionImpl(const std::string& url, const qpid::messaging::Variant::Map& options); void close(); - qpid::messaging::Session newSession(); + qpid::messaging::Session newSession(const std::string& name); + qpid::messaging::Session getSession(const std::string& name) const; void closed(SessionImpl&); void reconnect(); private: - typedef std::vector<qpid::messaging::Session> Sessions; + typedef std::map<std::string, qpid::messaging::Session> Sessions; - qpid::sys::Mutex lock;//used to protect data structures + mutable qpid::sys::Mutex lock;//used to protect data structures qpid::sys::Semaphore semaphore;//used to coordinate reconnection Sessions sessions; qpid::client::Connection connection; |
