-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.OS-Windows
Milestone
Description
What steps will reproduce the problem? run this program on windows package main import ( "log" "net" ) func dial() error { l, err := net.Listen("tcp", ":0") if err != nil { return err } go func() { c, err := l.Accept() if err != nil { return } c.Close() }() c, err := net.Dial("tcp", l.Addr().String()) if err != nil { return err } c.Close() return nil } func main() { err := dial() if err != nil { log.Fatal(err) } } What is the expected output? Should output noting. What do you see instead? 2013/08/30 16:43:22 dial tcp 0.0.0.0:1406: ConnectEx tcp: The format of the specified network name is invalid. Please use labels and text to provide additional information. The problem seems to be that l.Addr().String() returns '0.0.0.0', but connecting to that address is not allowed on windows. From http://msdn.microsoft.com/en-us/library/aa923167.aspx " ... If the address member of the structure specified by the name parameter is all zeroes, connect will return the error WSAEADDRNOTAVAIL. ..."
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.OS-Windows