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:
Russ Cox 2012-02-14 00:40:37 -05:00
parent b7360b9b06
commit 5e4e3d8e44
15 changed files with 440 additions and 200 deletions

View file

@ -83,7 +83,7 @@ func connect(t *testing.T, network, addr string, isEmpty bool) {
}
// Send explicit ending for unixpacket.
// Older Linux kernels do stop reads on close.
// Older Linux kernels do not stop reads on close.
if network == "unixpacket" {
fd.Write([]byte("END"))
}