Resurrect TcpListener::getMyAddresses()
It is needed by WinVNC, but got removed in 892d10a70. Also fix
a couple of issues:
- Use getnameinfo() in order to be compatible with Windows XP
- Make it static since it doesn't use a specific socket
- Respect UseIPv4 and UseIPv6
- Flags for getaddrinfo() that match binding code
- Dummy service value for Windows compatibility
diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx
index 36dbcee..0389985 100644
--- a/win/winvnc/VNCServerWin32.cxx
+++ b/win/winvnc/VNCServerWin32.cxx
@@ -101,8 +101,8 @@
// Fetch the list of addresses
std::list<char*> addrs;
- if (rfbSock.sock)
- rfbSock.sock->getMyAddresses(&addrs);
+ if (rfbSock.isListening())
+ TcpListener::getMyAddresses(&addrs);
else
addrs.push_front(strDup("Not accepting connections"));