This should be more efficient everywhere, and appears to be
required on Solaris.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
12583046
var hints C.struct_addrinfo
hints.ai_flags = cgoAddrInfoFlags()
+ hints.ai_socktype = C.SOCK_STREAM
h := C.CString(name)
defer C.free(unsafe.Pointer(h))
}
}
for r := res; r != nil; r = r.ai_next {
- // Everything comes back twice, once for UDP and once for TCP.
+ // We only asked for SOCK_STREAM, but check anyhow.
if r.ai_socktype != C.SOCK_STREAM {
continue
}