From 5e4e74053e0451f5a103820e99eac00992061b4c Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Fri, 12 Aug 2011 22:32:05 +0000 Subject: 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 --- cpp/src/qpid/sys/windows/SocketAddress.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cpp/src/qpid/sys/windows/SocketAddress.cpp') 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; -- cgit v1.2.1