1
0
mirror of https://github.com/golang/go synced 2024-11-20 05:44:44 -07:00
go/src
Dave Cheney f72c828c67 net: consolidate common socket functions
In resolving 3507, the fix had to be applied individually to
the four *Conn types, tcp, udp, rawip and unix, due to the
duplicate code in each Conn type.

This CL consolidates the common net.Conn methods that all four
*Conn types implement into a base conn type.

Pros:
* The fix for 3507 would have only needed to be applied to one
method. Further improvements, such as possibly removing the
c.fd != nil check in c.ok(), would benefit from this CL.
* Nearly 300 lines removed from the net package.
* The public interface and documentation are not changed.
* I think this is an excellent example of the power of embedding.

Cons:
* The net package is already distributed over many files, this
CL adds another place to look.
* The fix for 3507 was a total of 16 lines changed, this follow
up CL could be considered to be an overreaction as new Conn types
are unlikely to be added in the near future.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6098047
2012-04-27 22:17:08 +10:00
..
cmd cmd/go: new tag selection logic 2012-04-26 14:25:28 -04:00
lib9 lib9: fix warning under clang 3.1 2012-04-18 09:57:00 +10:00
libbio build: delete make paraphernalia 2012-02-06 13:34:25 -05:00
libmach runtime/pprof: support OS X CPU profiling 2012-02-28 16:18:24 -05:00
pkg net: consolidate common socket functions 2012-04-27 22:17:08 +10:00
all.bash build: run.bash no longer accepts --no-banner 2012-04-10 01:49:49 +08:00
all.bat build: use setlocal in run.bat 2012-02-16 10:44:55 +11:00
clean.bash build: fix clean.bash 2012-02-15 23:52:07 +09:00
clean.bat build: implement clean.bat 2012-02-20 12:17:27 +11:00
make.bash build: do more during windows build 2012-03-20 14:04:20 +11:00
make.bat build: do more during windows build 2012-03-20 14:04:20 +11:00
Make.dist cmd/dist: make 'make' quieter for developers 2012-02-08 15:26:47 -05:00
run.bash build: unset GOROOT_FINAL before tests 2012-04-04 23:14:54 +08:00
run.bat build: unset GOROOT_FINAL before tests 2012-04-04 23:14:54 +08:00
sudo.bash cmd/dist, sudo.bash: don't mention sudo.bash if cov or prof is not present 2012-04-02 22:33:38 +08:00