mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: avoid Shutdown during Close
Once we've evicted all the blocked I/O, the ref count should go to zero quickly, so it should be safe to postpone the close(2) until then. Fixes #1898. Fixes #2116. Fixes #2122. R=golang-dev, mikioh.mikioh, bradfitz, fullung, iant CC=golang-dev https://golang.org/cl/5649076
This commit is contained in:
parent
b7360b9b06
commit
5e4e3d8e44
15 changed files with 440 additions and 200 deletions
|
|
@ -114,6 +114,12 @@ func TestSelfConnect(t *testing.T) {
|
|||
if testing.Short() {
|
||||
n = 1000
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "darwin", "freebsd", "openbsd", "windows":
|
||||
// Non-Linux systems take a long time to figure
|
||||
// out that there is nothing listening on localhost.
|
||||
n = 100
|
||||
}
|
||||
for i := 0; i < n; i++ {
|
||||
c, err := Dial("tcp", addr)
|
||||
if err == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue