]> Cypherpunks repositories - gostls13.git/commit
net: make multi-IP resolution more flexible.
authorPaul Marks <pmarks@google.com>
Wed, 1 Apr 2015 22:17:09 +0000 (15:17 -0700)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 10 Apr 2015 09:03:25 +0000 (09:03 +0000)
commita5dec3859a8b5fa674c48b7e7099c53a3461bb6d
treeb03993a0e981a599bf67cd9b795d3ae3a0e1ad50
parent4b21be46701cca3dcfc81ecf2841dc71f041f553
net: make multi-IP resolution more flexible.

Remove the "netaddr" type, which ambiguously represented either one
address, or a list of addresses. Instead, use "addrList" wherever
multiple addresses are supported.

The "first" method returns the first address matching some condition
(e.g. "is it IPv4?"), primarily to support legacy code that can't handle
multiple addresses.

The "partition" method splits an addrList into two categories, as
defined by some strategy function. This is useful for implementing
Happy Eyeballs, and similar two-channel algorithms.

Finally, internetAddrList (formerly resolveInternetAddr) no longer
mangles the ordering defined by getaddrinfo. In the future, this may
be used by a sequential Dial implementation.

Updates #8453, #8455.

Change-Id: I7375f4c34481580ab40e31d33002a4073a0474f3
Reviewed-on: https://go-review.googlesource.com/8360
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
13 files changed:
src/net/dial.go
src/net/interface_linux.go
src/net/interface_windows.go
src/net/iprawsock.go
src/net/iprawsock_posix.go
src/net/ipsock.go
src/net/ipsock_test.go
src/net/sock_posix.go
src/net/tcpsock.go
src/net/udpsock.go
src/net/udpsock_posix.go
src/net/unixsock.go
src/net/unixsock_posix.go