diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp | 15 | ||||
-rw-r--r-- | cpp/src/qpid/messaging/Connection.cpp | 7 |
2 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp index 2ee9cf3fc0..6c3c9c5218 100644 --- a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp @@ -103,7 +103,7 @@ ConnectionImpl::ConnectionImpl(const std::string& url, const Variant::Map& optio { QPID_LOG(debug, "Created connection with " << options); setOptions(options); - urls.push_back(url); + urls.insert(urls.begin(), url); } void ConnectionImpl::setOptions(const Variant::Map& options) @@ -125,10 +125,15 @@ void ConnectionImpl::setOptions(const Variant::Map& options) void ConnectionImpl::setOption(const std::string& name, const Variant& value) { - Variant::Map options; - options[name] = value; - setOptions(options); - QPID_LOG(debug, "Set " << name << " to " << value); + if (name == "url") { + if (urls.size()) urls[0] = value.asString(); + else urls.insert(urls.begin(), value.asString()); + } else { + Variant::Map options; + options[name] = value; + setOptions(options); + QPID_LOG(debug, "Set " << name << " to " << value); + } } void ConnectionImpl::close() diff --git a/cpp/src/qpid/messaging/Connection.cpp b/cpp/src/qpid/messaging/Connection.cpp index 80e96af1d6..53d37562e7 100644 --- a/cpp/src/qpid/messaging/Connection.cpp +++ b/cpp/src/qpid/messaging/Connection.cpp @@ -54,6 +54,13 @@ Connection::Connection(const std::string& url, const Variant::Map& options) PI::ctor(*this, new qpid::client::amqp0_10::ConnectionImpl(url, options)); } +Connection::Connection() +{ + Variant::Map options; + std::string url = "amqp:tcp:127.0.0.1:5672"; + PI::ctor(*this, new qpid::client::amqp0_10::ConnectionImpl(url, options)); +} + void Connection::open() { impl->open(); } bool Connection::isOpen() { return impl->isOpen(); } void Connection::close() { impl->close(); } |