From 16da0e0c511c0c1cf4ea592640c522754065200a Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 11 May 2010 14:39:58 +0000 Subject: 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 --- cpp/src/qpid/client/Connection.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'cpp/src/qpid/client/Connection.cpp') 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(); + 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()); } -- cgit v1.2.1