1
0
mirror of https://github.com/golang/go synced 2024-10-04 13:21:22 -06:00
The Go programming language
Go to file
Paul Marks 0d8366e2d6 net: add sequential and RFC 6555-compliant TCP dialing.
dialSerial connects to a list of addresses in sequence.  If a
timeout is specified, then each address gets an equal fraction of the
remaining time, with a magic constant (2 seconds) to prevent
"dial a million addresses" from allotting zero time to each.

Normally, net.Dial passes the DNS stub resolver's output to dialSerial.
If an error occurs (like destination/port unreachable), it quickly skips
to the next address, but a blackhole in the network will cause the
connection to hang until the timeout elapses.  This is how UNIXy clients
traditionally behave, and is usually sufficient for non-broken networks.

The DualStack flag enables dialParallel, which implements Happy Eyeballs
by racing two dialSerial goroutines, giving the preferred family a
head start (300ms by default).  This allows clients to avoid long
timeouts when the network blackholes IPv4 xor IPv6.

Fixes #8453
Fixes #8455
Fixes #8847

Change-Id: Ie415809c9226a1f7342b0217dcdd8f224ae19058
Reviewed-on: https://go-review.googlesource.com/8768
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-16 02:38:21 +00:00
api api: refresh next.txt 2015-05-14 21:31:18 +00:00
doc doc: update install-source.html to cover new architectures 2015-06-16 01:04:10 +00:00
lib/time remove the obsolete lib/codereview. 2014-12-08 07:51:54 +00:00
misc cmd/go: support -buildmode=shared with gccgo 2015-06-16 01:43:29 +00:00
src net: add sequential and RFC 6555-compliant TCP dialing. 2015-06-16 02:38:21 +00:00
test cmd/compile: use generated temps in bool codegen 2015-06-09 17:38:26 +00:00
.gitattributes .gitattributes: prevent all magic line ending changes 2014-12-12 23:14:54 +00:00
.gitignore .gitignore: ignore y.output 2015-06-10 00:28:52 +00:00
AUTHORS A+C: add another email address for Emil Hessman 2014-11-12 10:01:23 -08:00
CONTRIBUTING.md doc: direct people to the mailing list 2015-01-18 21:27:07 +00:00
CONTRIBUTORS CONTRIBUTORS: add Burcu Dogan's personal mail 2015-05-06 16:06:42 +00:00
favicon.ico godoc: update favicon 2012-10-11 17:02:36 +11:00
LICENSE doc: update licensing text one more time 2012-03-27 15:09:13 +11:00
PATENTS
README.md doc: fix broken link in README 2015-02-19 05:50:57 +00:00
robots.txt godoc: serve robots.txt raw 2011-02-19 05:46:20 +11:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image

For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Please report issues here: https://golang.org/issue/new

Go is the work of hundreds of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Please note that we do not use pull requests.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:

export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin

See https://golang.org/doc/install or doc/install.html for more details.