summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/client/Connection.cpp')
-rw-r--r--cpp/src/qpid/client/Connection.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp
index 6d2fd1d760..2882ef5d42 100644
--- a/cpp/src/qpid/client/Connection.cpp
+++ b/cpp/src/qpid/client/Connection.cpp
@@ -71,19 +71,18 @@ void Connection::open(const Url& url, const ConnectionSettings& settings) {
throw Exception(QPID_MSG("Attempt to open URL with no addresses."));
Url::const_iterator i = url.begin();
do {
- const TcpAddress* tcp = i->get<TcpAddress>();
+ const Address& addr = *i;
i++;
- if (tcp) {
- try {
- ConnectionSettings cs(settings);
- cs.host = tcp->host;
- cs.port = tcp->port;
- open(cs);
- break;
- }
- catch (const Exception& /*e*/) {
- if (i == url.end()) throw;
- }
+ try {
+ ConnectionSettings cs(settings);
+ cs.protocol = addr.protocol;
+ cs.host = addr.host;
+ cs.port = addr.port;
+ open(cs);
+ break;
+ }
+ catch (const Exception& /*e*/) {
+ if (i == url.end()) throw;
}
} while (i != url.end());
}