summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/windows/SocketAddress.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-06-19 17:59:52 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-06-19 17:59:52 +0000
commit4258c2460aad93e4f6783209eae73d7ddbe2b8c8 (patch)
tree74065dba1a50ef76fec7b06add966af1a013fa1b /cpp/src/qpid/sys/windows/SocketAddress.cpp
parent3ad9bfa66c4389c7629d757ecd6d63f28945aaa1 (diff)
downloadqpid-python-4258c2460aad93e4f6783209eae73d7ddbe2b8c8.tar.gz
QPID-4931: Remove removed member function from windows SocketAddress
code too. While there bring this code up to date with other recent changes to the POSIX equivalent code. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1494712 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/windows/SocketAddress.cpp')
-rw-r--r--cpp/src/qpid/sys/windows/SocketAddress.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/cpp/src/qpid/sys/windows/SocketAddress.cpp b/cpp/src/qpid/sys/windows/SocketAddress.cpp
index 77bbf85810..b5146678af 100644
--- a/cpp/src/qpid/sys/windows/SocketAddress.cpp
+++ b/cpp/src/qpid/sys/windows/SocketAddress.cpp
@@ -39,14 +39,16 @@ namespace sys {
SocketAddress::SocketAddress(const std::string& host0, const std::string& port0) :
host(host0),
port(port0),
- addrInfo(0)
+ addrInfo(0),
+ currentAddrInfo(0)
{
}
SocketAddress::SocketAddress(const SocketAddress& sa) :
host(sa.host),
port(sa.port),
- addrInfo(0)
+ addrInfo(0),
+ currentAddrInfo(0)
{
}
@@ -104,6 +106,11 @@ std::string SocketAddress::asString(bool numeric) const
return asString(ai.ai_addr, ai.ai_addrlen);
}
+std::string SocketAddress::getHost() const
+{
+ return host;
+}
+
bool SocketAddress::nextAddress() {
bool r = currentAddrInfo->ai_next != 0;
if (r)
@@ -111,17 +118,6 @@ bool SocketAddress::nextAddress() {
return r;
}
-void SocketAddress::setAddrInfoPort(uint16_t port) {
- if (!currentAddrInfo) return;
-
- ::addrinfo& ai = *currentAddrInfo;
- switch (ai.ai_family) {
- case AF_INET: ((::sockaddr_in*)ai.ai_addr)->sin_port = htons(port); return;
- case AF_INET6:((::sockaddr_in6*)ai.ai_addr)->sin6_port = htons(port); return;
- default: throw Exception(QPID_MSG("Unexpected socket type"));
- }
-}
-
const ::addrinfo& getAddrInfo(const SocketAddress& sa)
{
if (!sa.addrInfo) {