mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: deduplicate TCP socket code
This change consolidates functions and methods related to TCPAddr, TCPConn and TCPListener for maintenance purpose, especially for documentation. Also refactors Dial error code paths. The followup changes will update comments and examples. Updates #10624. Change-Id: I3333ee218ebcd08928f9e2826cd1984d15ea153e Reviewed-on: https://go-review.googlesource.com/20009 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
533f30b924
commit
b0f4ee533a
13 changed files with 326 additions and 405 deletions
|
|
@ -91,6 +91,9 @@ second:
|
|||
case *os.SyscallError:
|
||||
nestedErr = err.Err
|
||||
goto third
|
||||
case *os.PathError: // for Plan 9
|
||||
nestedErr = err.Err
|
||||
goto third
|
||||
}
|
||||
switch nestedErr {
|
||||
case errCanceled, errClosing, errMissingAddress:
|
||||
|
|
@ -543,6 +546,9 @@ second:
|
|||
case *os.SyscallError:
|
||||
nestedErr = err.Err
|
||||
goto third
|
||||
case *os.PathError: // for Plan 9
|
||||
nestedErr = err.Err
|
||||
goto third
|
||||
}
|
||||
switch nestedErr {
|
||||
case errClosing, errTimeout:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue