• Paul Marks's avatar
    net: make multi-IP resolution more flexible. · a5dec385
    Paul Marks authored
    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/8360Reviewed-by: 's avatarMikio Hara <mikioh.mikioh@gmail.com>
    Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    a5dec385
tcpsock.go 1.45 KB