4 ms·
net.Dial is a special case at the moment. It will have natural timeout behavior in the future, just like Reads and Writes do. See the comment here: http://gola
by james4k 14y ago
net.Dial is a special case at the moment. It will have natural timeout behavior in the future, just like Reads and Writes do.
See the comment here: http://golang.org/src/pkg/net/dial.go?s=3003:3074#L110 http://golang.org/src/pkg/net/dial.go?s=3003:3074#L110
Edit: In practice, this isn't really a problem at all unless you're calling Dial something like a hundred or thousand times a minute and they're all timing out. Goroutines are very cheap. Still, it is an issue and will hopefully be resolved in Go1.1: http://code.google.com/p/go/issues/detail?id=2631 http://code.google.com/p/go/issues/detail?id=2631