Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: no deadline support for net.Dial*, Resolve*, Lookup*, etc #6340

Closed
niemeyer opened this issue Sep 6, 2013 · 7 comments
Closed

net: no deadline support for net.Dial*, Resolve*, Lookup*, etc #6340

niemeyer opened this issue Sep 6, 2013 · 7 comments

Comments

@niemeyer
Copy link
Contributor

niemeyer commented Sep 6, 2013

The deadline support introduced in the net package is currently restricted to dialing
(network, address string) via net.DialTimeout or Dialer, or to already established
connections. It would be valuable to have more functionality covered.

The specific use case at hand when this was missed was with ResolveTCPAddr and DialTCP.
It's not possible to timeout the resolution, and once an address is obtained, the only
way to dial with a timeout is by stringifying the address again and submitting into
DialTimeout or Dialer for re-parsing.
@niemeyer
Copy link
Contributor Author

niemeyer commented Sep 6, 2013

Comment 1:

Thread in golang-dev:
https://groups.google.com/d/topic/golang-dev/vvZ4DBMFeuQ/discussion

@niemeyer
Copy link
Contributor Author

niemeyer commented Sep 6, 2013

Comment 2:

Labels changed: added go1.3maybe, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added repo-main.

@niemeyer
Copy link
Contributor Author

niemeyer commented Jul 8, 2014

Comment 6:

Was just hit by this issue again:
    https://jira.mongodb.org/browse/MGO-34
Temporary hack:
    https://gist.github.com/niemeyer/f39e67dc12341a13705a

@LionNatsu
Copy link
Contributor

Maybe close this?

@bradfitz
Copy link
Contributor

bradfitz commented Feb 5, 2017

Thanks. Yeah, this was fixed in Go 1.8:

pkg net, method (*Resolver) LookupAddr(context.Context, string) ([]string, error)
pkg net, method (*Resolver) LookupCNAME(context.Context, string) (string, error)
pkg net, method (*Resolver) LookupHost(context.Context, string) ([]string, error)
pkg net, method (*Resolver) LookupIPAddr(context.Context, string) ([]IPAddr, error)
pkg net, method (*Resolver) LookupMX(context.Context, string) ([]*MX, error)
pkg net, method (*Resolver) LookupNS(context.Context, string) ([]*NS, error)
pkg net, method (*Resolver) LookupPort(context.Context, string, string) (int, error)
pkg net, method (*Resolver) LookupSRV(context.Context, string, string, string) (string, []*SRV, error)
pkg net, method (*Resolver) LookupTXT(context.Context, string) ([]string, error)
pkg net, type Dialer struct, Resolver *Resolver
pkg net, type Resolver struct
pkg net, type Resolver struct, PreferGo bool
pkg net, var DefaultResolver *Resolver

@bradfitz bradfitz closed this as completed Feb 5, 2017
@golang golang locked and limited conversation to collaborators Feb 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants