Browse Source

[master] use TCP socket to emulate the scenario of duplicate bind();
on Solaris SO_REUSEADDR allow multiple UDP sockets bound to the same port
(seemingly for the old multicast extension).
committing it at my discretion as it's simple and the problem made buildbot
fail.

JINMEI Tatuya 13 years ago
parent
commit
1293abbaa7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/bin/resolver/tests/resolver_config_unittest.cc

+ 2 - 2
src/bin/resolver/tests/resolver_config_unittest.cc

@@ -197,8 +197,8 @@ createSocket(const char* address, const char* port) {
     struct addrinfo hints, *res;
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = AF_UNSPEC;
-    hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_protocol = IPPROTO_UDP;
+    hints.ai_socktype = SOCK_STREAM;
+    hints.ai_protocol = IPPROTO_TCP;
     hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
     const int error = getaddrinfo(address, port, &hints, &res);
     if (error != 0) {