use getaddrinfo() AI_PASSIVE flag, to remove "::" and "0.0.0.0"

This commit is contained in:
SASANO Takayoshi
2020-04-05 07:05:33 +09:00
parent 15b5011ebf
commit 88bbb0cd0f
2 changed files with 22 additions and 25 deletions

View File

@@ -50,6 +50,7 @@ public:
void close();
static int lookup(const std::string& hostName, unsigned int port, sockaddr_storage &address, unsigned int &address_length);
static int lookup(const std::string& hostName, unsigned int port, sockaddr_storage &address, unsigned int &address_length, struct addrinfo &hints);
static bool match(const sockaddr_storage &addr1, const sockaddr_storage &addr2);
static bool isnone(const sockaddr_storage &addr);