An error occurred fetching the project authors.
- 15 Dec, 2015 1 commit
-
-
Brad Fitzpatrick authored
Dialer.Cancel is a new optional <-chan struct{} channel whose closure indicates that the dial should be canceled. It is compatible with the x/net/context and http.Request.Cancel types. Tested by hand with: package main import ( "log" "net" "time" ) func main() { log.Printf("start.") var d net.Dialer cancel := make(chan struct{}) time.AfterFunc(2*time.Second, func() { log.Printf("timeout firing") close(cancel) }) d.Cancel = cancel c, err := d.Dial("tcp", "192.168.0.1:22") if err != nil { log.Print(err) return } log.Fatalf("unexpected connect: %v", c) } Which says: 2015/12/14 22:24:58 start. 2015/12/14 22:25:00 timeout firing 2015/12/14 22:25:00 dial tcp 192.168.0.1:22: operation was canceled Fixes #11225 Change-Id: I2ef39e3a540e29fe6bfec03ab7a629a6b187fcb3 Reviewed-on: https://go-review.googlesource.com/17821Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 23 Jul, 2015 1 commit
-
-
Paul Marks authored
When dialing with a relative Timeout instead of an absolute Deadline, the deadline function only makes sense if called before doing any time-consuming work. This change calls deadline exactly once, storing the result until the Dial operation completes. The partialDeadline implementation is reverted to the following patch set 3: https://go-review.googlesource.com/#/c/8768/3..4/src/net/dial.go Otherwise, when dialing a name with multiple IP addresses, or when DNS is slow, the recomputed deadline causes the total Timeout to exceed that requested by the user. Fixes #11796 Change-Id: I5e1f0d545f9e86a4e0e2ac31a9bd108849cf0fdf Reviewed-on: https://go-review.googlesource.com/12442 Run-TryBot: Paul Marks <pmarks@google.com> Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 16 Jun, 2015 1 commit
-
-
Paul Marks authored
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/8768Reviewed-by:
Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 29 Apr, 2015 1 commit
-
-
Mikio Hara authored
Not only by network, transport-layer intermediaries but by virtualization stuff in a node, it is hard to identify the root cause of weird faults without information of packet flows after disaster happened. This change adds Source field to OpError to be able to represent a 5-tuple of internet transport protocols for helping dealing with complicated systems. Also clarifies the usage of Source and Addr fields. Updates #4856. Change-Id: I96a523fe391ed14406bfb21604c461d4aac2fa19 Reviewed-on: https://go-review.googlesource.com/9231Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 21 Apr, 2015 1 commit
-
-
Mikio Hara authored
This change fixes inconsistent error values on Set{Deadline,ReadDeadline,WriteDeadline,ReadBuffer,WriteBuffer} for Conn, Listener and PacketConn, and Set{KeepAlive,KeepAlivePeriod,Linger,NoDelay} for TCPConn. Updates #4856. Change-Id: I34ca5e98f6de72863f85b2527478b20d8d5394dd Reviewed-on: https://go-review.googlesource.com/9109Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 10 Apr, 2015 1 commit
-
-
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:
Mikio Hara <mikioh.mikioh@gmail.com> Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 07 Apr, 2015 1 commit
-
-
Mikio Hara authored
Change-Id: I1f2d4e3b0351a7a47c3a6073833a17dbc0c7b05c Reviewed-on: https://go-review.googlesource.com/8520Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 09 Feb, 2015 1 commit
-
-
Dmitry Vyukov authored
When we use dialMulti we also allocate dialSingle closure for no reason. Change-Id: I074282a9d6e2c2a1063ab311a1b95e10fe65219f Reviewed-on: https://go-review.googlesource.com/4119Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 08 Sep, 2014 1 commit
-
-
Russ Cox authored
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
-
- 02 Aug, 2014 1 commit
-
-
Brad Fitzpatrick authored
LGTM=r R=golang-codereviews, r CC=adg, golang-codereviews https://golang.org/cl/118550043
-
- 20 Jun, 2014 1 commit
-
-
Dmitriy Vyukov authored
Single-case select with a non-nil channel is pointless. LGTM=mikioh.mikioh R=mikioh.mikioh CC=golang-codereviews https://golang.org/cl/103920044
-
- 24 Feb, 2014 1 commit
-
-
Brad Fitzpatrick authored
LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/68380043
-
- 19 Dec, 2013 1 commit
-
-
Mikio Hara authored
Also removes an unused variable. Fixes #6795. R=adg, dave, bradfitz, gobot CC=golang-dev https://golang.org/cl/29440043
-
- 18 Oct, 2013 1 commit
-
-
Russ Cox authored
Fixes #6614. R=golang-dev, bradfitz, mikioh.mikioh CC=golang-dev https://golang.org/cl/14950045
-
- 11 Sep, 2013 1 commit
-
-
Mikio Hara authored
This CL adds minimal support of Happy Eyeballs-like TCP connection setup to Dialer API. Happy Eyeballs and derivation techniques are described in the following: - Happy Eyeballs: Success with Dual-Stack Hosts http://tools.ietf.org/html/rfc6555 - Analysing Dual Stack Behaviour and IPv6 Quality http://www.potaroo.net/presentations/2012-04-17-dual-stack-quality.pdf Usually, the techniques consist of three components below. - DNS query racers, that run A and AAAA queries in parallel or series - A short list of destination addresses - TCP SYN racers, that run IPv4 and IPv6 transport in parallel or series This CL implements only the latter two. The existing DNS query component gathers together A and AAAA records in series, so we don't touch it here. This CL just uses extended resolveInternetAddr and makes it possible to run multiple Dial racers in parallel. For example, when the given destination is a DNS name and the name has multiple address family A and AAAA records, and it happens on the TCP wildcard network "tcp" with DualStack=true like the following: (&net.Dialer{DualStack: true}).Dial("tcp", "www.example.com:80") The function will return a first established connection either TCP over IPv4 or TCP over IPv6, and close the other connection internally. Fixes #3610. Fixes #5267. Benchmark results on freebsd/amd64 virtual machine, tip vs. tip+12416043: benchmark old ns/op new ns/op delta BenchmarkTCP4OneShot 50696 52141 +2.85% BenchmarkTCP4OneShotTimeout 65775 66426 +0.99% BenchmarkTCP4Persistent 10986 10457 -4.82% BenchmarkTCP4PersistentTimeout 11207 10445 -6.80% BenchmarkTCP6OneShot 62009 63718 +2.76% BenchmarkTCP6OneShotTimeout 78351 79138 +1.00% BenchmarkTCP6Persistent 14695 14659 -0.24% BenchmarkTCP6PersistentTimeout 15032 14646 -2.57% BenchmarkTCP4ConcurrentReadWrite 7215 6217 -13.83% BenchmarkTCP6ConcurrentReadWrite 7528 7493 -0.46% benchmark old allocs new allocs delta BenchmarkTCP4OneShot 36 36 0.00% BenchmarkTCP4OneShotTimeout 36 36 0.00% BenchmarkTCP4Persistent 0 0 n/a% BenchmarkTCP4PersistentTimeout 0 0 n/a% BenchmarkTCP6OneShot 37 37 0.00% BenchmarkTCP6OneShotTimeout 37 37 0.00% BenchmarkTCP6Persistent 0 0 n/a% BenchmarkTCP6PersistentTimeout 0 0 n/a% BenchmarkTCP4ConcurrentReadWrite 0 0 n/a% BenchmarkTCP6ConcurrentReadWrite 0 0 n/a% benchmark old bytes new bytes delta BenchmarkTCP4OneShot 2500 2503 0.12% BenchmarkTCP4OneShotTimeout 2508 2505 -0.12% BenchmarkTCP4Persistent 0 0 n/a% BenchmarkTCP4PersistentTimeout 0 0 n/a% BenchmarkTCP6OneShot 2713 2707 -0.22% BenchmarkTCP6OneShotTimeout 2722 2720 -0.07% BenchmarkTCP6Persistent 0 0 n/a% BenchmarkTCP6PersistentTimeout 0 0 n/a% BenchmarkTCP4ConcurrentReadWrite 0 0 n/a% BenchmarkTCP6ConcurrentReadWrite 0 0 n/a% R=golang-dev, bradfitz, nightlyone, rsc CC=golang-dev https://golang.org/cl/12416043
-
- 30 Aug, 2013 1 commit
-
-
Mikio Hara authored
This CL adds the netaddr interface that will carry a single network endpoint address or a short list of IP addresses to dial helper functions in the upcoming CLs. This is in preparation for TCP connection setup with fast failover on dual IP stack node as described in RFC 6555. Update #3610 Update #5267 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/13368044
-
- 14 Aug, 2013 1 commit
-
-
Mikio Hara authored
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12884044
-
- 13 Aug, 2013 1 commit
-
-
Mikio Hara authored
Update #4856 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/12763044
-
- 02 Apr, 2013 1 commit
-
-
Brad Fitzpatrick authored
Per discussions on golang-nuts and golang-dev: "Some concerns with DialOpt" https://groups.google.com/d/msg/golang-nuts/Hfh9aqhXyUw/W3uYi8lOdKcJ https://groups.google.com/d/msg/golang-dev/37omSQeWv4Y/KASGIfPpXh0J R=golang-dev, google, r CC=golang-dev https://golang.org/cl/8274043
-
- 23 Mar, 2013 1 commit
-
-
Mikio Hara authored
This CL provides IPv6 scoped addressing zone support as defined in RFC 4007 for internet protocol family connection setups. Follwoing types and functions allow a literal IPv6 address with zone identifer as theirs parameter. pkg net, func Dial(string, string) (Conn, error) pkg net, func DialOpt(string, ...DialOption) (Conn, error) pkg net, func DialTimeout(string, string, time.Duration) (Conn, error) pkg net, func Listen(string, string) (Listener, error) pkg net, func ListenPacket(string, string) (PacketConn, error) pkg net, func ResolveIPAddr(string, string) (*IPAddr, error) pkg net, func ResolveTCPAddr(string, string) (*TCPAddr, error) pkg net, func ResolveUDPAddr(string, string) (*UDPAddr, error) pkg net, type IPAddr struct, Zone string pkg net, type TCPAddr struct, Zone string pkg net, type UDPAddr struct, Zone string Also follwoing methods return a literal IPv6 address with zone identifier string if possible. pkg net, method (*IPAddr) String() string pkg net, method (*TCPAddr) String() string pkg net, method (*UDPAddr) String() string Fixes #4234. Fixes #4501. Update #5081. R=rsc, iant CC=golang-dev https://golang.org/cl/6816116
-
- 11 Mar, 2013 1 commit
-
-
Brad Fitzpatrick authored
Take advantage of the new terminating statement rule. R=golang-dev, r, gri CC=golang-dev https://golang.org/cl/7712044
-
- 10 Mar, 2013 1 commit
-
-
Brad Fitzpatrick authored
Previously it was evaluated once, so re-using the timeout option repeatedly would always generate the same deadine. Also switch to doing just one pass over the options, making the private interface actually useful. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/7608045
-
- 27 Feb, 2013 1 commit
-
-
Brad Fitzpatrick authored
Add DialOpt. So we have: func Dial(net, addr string) (Conn, error) func DialTimeout(net, addr string, timeout time.Duration) (Conn, error) func DialOpt(addr string, opts ...DialOption) (Conn, error) DialTimeout (and Dial) are regrettable in retrospect. Maybe in a future Go we'll be back down to one Dial, with DialOpt becoming Dial. DialOpt looks like: c, err := net.DialOpt("google.com:80") // tcp is default c, err := net.DialOpt("google.com:80", net.Timeout(30 * time.Second)) c, err := net.DialOpt("google.com:80", net.TCPFastOpen()) c, err := net.DialOpt("google.com:80", net.LocalAddr(..)) c, err := net.DialOpt("google.com:53", net.Network("udp6")) And then: (clustered in godoc) type DialOption interface { /* private only */ } func Deadline(time.Time) DialOption func LocalAddr(Addr) DialOption func Network(string) DialOption func TCPFastOpen() DialOption func Timeout(time.Duration) DialOption I'm pretty confident we could add Happy Eyeballs to this too. Fixes #3097 Update #3610 Update #4842 R=golang-dev, r, dave, minux.ma, rsc CC=golang-dev https://golang.org/cl/7365049
-
- 08 Feb, 2013 2 commits
-
-
Mikio Hara authored
The socket for AF_UNIX domain with SOCK_DGARM type isn't allowed to work with syscall listen. R=rsc CC=golang-dev https://golang.org/cl/7310068
-
Mikio Hara authored
R=golang-dev, dave, bradfitz CC=golang-dev https://golang.org/cl/7300065
-
- 11 Jan, 2013 1 commit
-
-
Alex Brainman authored
Update #2631. Update #3097. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7061060
-
- 16 Dec, 2012 1 commit
-
-
Mikio Hara authored
This CL breaks Go 1 API compatibility but it doesn't matter because previous ListenUnixgram doesn't work in any use cases, oops. The public API change is: -pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error) +pkg net, func ListenUnixgram(string, *UnixAddr) (*UnixConn, error) Fixes #3875. R=rsc, golang-dev, dave CC=golang-dev https://golang.org/cl/6937059
-
- 27 Nov, 2012 1 commit
-
-
Mikio Hara authored
This CL continues with introducing IPv6 scoped addressing capability into the net package. Update #4234. R=rsc CC=golang-dev https://golang.org/cl/6842053
-
- 08 Nov, 2012 1 commit
-
-
Brad Fitzpatrick authored
Integrates with the pollserver now. Uses the old implementation on windows and plan9. Fixes #2631 R=paul, iant, adg, bendaglish, rsc CC=golang-dev https://golang.org/cl/6815049
-
- 20 Sep, 2012 1 commit
-
-
Mikio Hara authored
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6546044
-
- 19 Jul, 2012 1 commit
-
-
Mikio Hara authored
R=golang-dev, bsiegert, r CC=golang-dev https://golang.org/cl/6428050
-
- 28 Feb, 2012 1 commit
-
-
Mikio Hara authored
We should use DialUnix or ListenPacket for unixgram networks because Dial doesn't take a local UnixAddr. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5706043
-
- 14 Feb, 2012 1 commit
-
-
Mikio Hara authored
This CL avoids net.Listen("tcp", ":80"), http.ListenAdnServe(":80") prefer an IPv6 listen. R=rsc CC=golang-dev https://golang.org/cl/5669043
-
- 21 Jan, 2012 1 commit
-
-
Mikio Hara authored
Fixes #2654. R=rsc CC=golang-dev https://golang.org/cl/5545058
-
- 20 Dec, 2011 1 commit
-
-
Brad Fitzpatrick authored
Fixes #240 R=adg, dsymonds, rsc, r, mikioh.mikioh CC=golang-dev https://golang.org/cl/5491062
-
- 02 Nov, 2011 1 commit
-
-
Russ Cox authored
R=golang-dev, bsiegert, iant CC=golang-dev https://golang.org/cl/5294074
-
- 18 Oct, 2011 1 commit
-
-
Andrey Mirtchovski authored
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5293045
-
- 30 Jun, 2011 1 commit
-
-
Brad Fitzpatrick authored
No API or functional change. R=jacek.masiulaniec, mikioh.mikioh, rsc CC=golang-dev https://golang.org/cl/4630081
-
- 16 May, 2011 1 commit
-
-
Mikio Hara authored
This CL will help to make an adaptive address family selection possible when an any address family, vague network string such as "ip", "tcp" or "udp" is passed to Dial and Listen API. Fixes #1769. R=bradfitz, rsc CC=golang-dev https://golang.org/cl/4438066
-
- 20 Apr, 2011 1 commit
-
-
Russ Cox authored
This CL makes it possible to resolve DNS names on OS X without offending the Application-Level Firewall. It also means that cross-compiling from one operating system to another is no longer possible when using package net, because cgo needs to be able to sniff around the local C libraries. We could special-case this one use and check in generated files, but it seems more trouble than it's worth. Cross compiling is dead anyway. It is still possible to use either GOARCH=amd64 or GOARCH=386 on typical Linux and OS X x86 systems. It is also still possible to build GOOS=linux GOARCH=arm on any system, because arm is for now excluded from this change (there is no cgo for arm yet). R=iant, r, mikioh CC=golang-dev https://golang.org/cl/4437053
-