aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-12-13 21:02:14 -0800
committerIan Lance Taylor <iant@golang.org>2016-12-15 02:15:18 +0000
commitcd2b6bd3c4a7489299e291a74ef7f845aa80c995 (patch)
treec99d6964e7b374b5d15efe910c6b368a44fb78fe /src/net
parent627af57b5464e025422356dc3f7442465f79991f (diff)
downloadgo-cd2b6bd3c4a7489299e291a74ef7f845aa80c995.tar.xz
net: fix consecutive dialing docs
Update #17617. Change-Id: Ia0bc9954bb914b650b7c7af35ef714ca6b0740b4 Reviewed-on: https://go-review.googlesource.com/34376 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/dial.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/net/dial.go b/src/net/dial.go
index a281b4554e..e30f636fb3 100644
--- a/src/net/dial.go
+++ b/src/net/dial.go
@@ -265,7 +265,7 @@ func (r *Resolver) resolveAddrList(ctx context.Context, op, network, addr string
// Dial("ip6:ipv6-icmp", "2001:db8::1")
//
// For Unix networks, the address must be a file system path.
-
+//
// If the host is resolved to multiple addresses,
// Dial will try each address in order until one succeeds.
func Dial(network, address string) (Conn, error) {
@@ -302,11 +302,13 @@ func (d *Dialer) Dial(network, address string) (Conn, error) {
// connected, any expiration of the context will not affect the
// connection.
//
-// If the host in the address parameter resolves to multiple network addresses,
-// and if a timeout is given, the connection to each address is given an
-// appropriate fraction of the time to connect. For example, if a host has
-// 4 IP addresses and the timeout is 1 minute, the connect to each single
-// address will be given 15 seconds to complete before trying the next one.
+// When using TCP, and the host in the address parameter resolves to multiple
+// network addresses, any dial timeout (from d.Timeout or ctx) is spread
+// over each consecutive dial, such that each is given an appropriate
+// faction of the time to connect.
+// For example, if a host has 4 IP addresses and the timeout is 1 minute,
+// the connect to each single address will be given 15 seconds to complete
+// before trying the next one.
//
// See func Dial for a description of the network and address
// parameters.