Commit 1293abba authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[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.
parent 3f9c1cb4
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment