Merge pull request #15654 from minggo/ipv6-compatibility

Ipv6 compatibility
This commit is contained in:
minggo 2016-05-17 09:25:14 +08:00
commit abe020e808
2 changed files with 2 additions and 2 deletions

View File

@ -422,7 +422,7 @@ bool Console::listenOnTCP(int port)
bzero(&hints, sizeof(struct addrinfo));
hints.ai_flags = AI_PASSIVE;
hints.ai_family = AF_INET; // AF_UNSPEC: Do we need IPv6 ?
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)

View File

@ -1886,7 +1886,7 @@ static void serverEntryPoint(unsigned int port)
struct addrinfo hints, *result = nullptr, *rp = nullptr;
int s = 0;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_INET; // IPv4
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM; // TCP stream sockets
hints.ai_flags = AI_PASSIVE; // fill in my IP for me