summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/windows/SocketAddress.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2011-08-12 22:32:05 +0000
committerAndrew Stitcher <astitcher@apache.org>2011-08-12 22:32:05 +0000
commit5e4e74053e0451f5a103820e99eac00992061b4c (patch)
tree17e31c3aa347ecc0cf59001f3c82120481f5f6bd /cpp/src/qpid/sys/windows/SocketAddress.cpp
parent6035aef61fe726180a918a57a93d66833eaca96a (diff)
downloadqpid-python-5e4e74053e0451f5a103820e99eac00992061b4c.tar.gz
QPID-3405: IPv6 support for Unix C++ ports:
- On the Listen side we create separate listening sockets for IPv4 and IPv6 making sure to not allow the IPv6 socket to run dual stack. This makes the reported IPv4 addresses look "normal" and would allow us to turn control IPv4/IPv6 listening separately. - On the connect side we make sure to try all the addresses returned by getaddrinfo() in order until we either find one that connects or have tried all of them. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1157272 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/windows/SocketAddress.cpp')
-rw-r--r--cpp/src/qpid/sys/windows/SocketAddress.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/windows/SocketAddress.cpp b/cpp/src/qpid/sys/windows/SocketAddress.cpp
index ac43cd2d23..b040cc5f14 100644
--- a/cpp/src/qpid/sys/windows/SocketAddress.cpp
+++ b/cpp/src/qpid/sys/windows/SocketAddress.cpp
@@ -68,6 +68,13 @@ std::string SocketAddress::asString(bool) const
return host + ":" + port;
}
+bool SocketAddress::nextAddress() {
+ bool r = currentAddrInfo->ai_next != 0;
+ if (r)
+ currentAddrInfo = currentAddrInfo->ai_next;
+ return r;
+}
+
const ::addrinfo& getAddrInfo(const SocketAddress& sa)
{
return *sa.addrInfo;