summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/posix/SystemInfo.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/sys/posix/SystemInfo.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/sys/posix/SystemInfo.cpp')
-rwxr-xr-xcpp/src/qpid/sys/posix/SystemInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/posix/SystemInfo.cpp b/cpp/src/qpid/sys/posix/SystemInfo.cpp
index 3c11b04d29..a19ab6885c 100755
--- a/cpp/src/qpid/sys/posix/SystemInfo.cpp
+++ b/cpp/src/qpid/sys/posix/SystemInfo.cpp
@@ -50,7 +50,7 @@ long SystemInfo::concurrency() {
#endif
}
-bool SystemInfo::getLocalHostname (TcpAddress &address) {
+bool SystemInfo::getLocalHostname (Address &address) {
char name[HOST_NAME_MAX];
if (::gethostname(name, sizeof(name)) != 0)
return false;
@@ -59,6 +59,7 @@ bool SystemInfo::getLocalHostname (TcpAddress &address) {
}
static const string LOCALHOST("127.0.0.1");
+static const string TCP("tcp");
void SystemInfo::getLocalIpAddresses (uint16_t port,
std::vector<Address> &addrList) {
@@ -83,7 +84,7 @@ void SystemInfo::getLocalIpAddresses (uint16_t port,
}
string addr(dispName);
if (addr != LOCALHOST) {
- addrList.push_back(TcpAddress(addr, port));
+ addrList.push_back(Address(TCP, addr, port));
}
break;
}
@@ -97,7 +98,7 @@ void SystemInfo::getLocalIpAddresses (uint16_t port,
freeifaddrs(ifaddr);
if (addrList.empty()) {
- addrList.push_back(TcpAddress(LOCALHOST, port));
+ addrList.push_back(Address(TCP, LOCALHOST, port));
}
}