summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connection.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-05-11 14:39:58 +0000
committerAlan Conway <aconway@apache.org>2010-05-11 14:39:58 +0000
commit16da0e0c511c0c1cf4ea592640c522754065200a (patch)
tree59fb80994db731fabe19897c95a6912e68716360 /cpp/src/qpid/client/Connection.cpp
parentbe8e1bf6b6a0d760bddbbe6642d477a95f36ab42 (diff)
downloadqpid-python-16da0e0c511c0c1cf4ea592640c522754065200a.tar.gz
Support for multiple protocols in qpid::Url.
- simplified qpid::Address to hold (protocol,host,port) triples. - protocol plugins call Url:addProtocol to add tags to Url parser. - use Address::protocol when establishing connections. - ssl_test: tests using URL to connect. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@943130 13f79535-47bb-0310-9956-ffa450edef68
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());
}