Chore: Clarify the definition of StreamConn and DialContext

This commit is contained in:
Dreamacro
2021-03-22 23:26:20 +08:00
parent 1355196b7c
commit 807d53c1e7
9 changed files with 79 additions and 46 deletions

View File

@ -98,3 +98,9 @@ func resolveUDPAddr(network, address string) (*net.UDPAddr, error) {
}
return net.ResolveUDPAddr(network, net.JoinHostPort(ip.String(), port))
}
func safeConnClose(c net.Conn, err error) {
if err != nil {
c.Close()
}
}