Improving net's deadline support

201 views
Skip to first unread message

Gustavo Niemeyer

unread,
Sep 3, 2013, 6:36:59 AM9/3/13
to golang-dev
Right now we can only have a timeout during the dial or name
resolution phase if we use the net.Dial function, but not with any of
the other Dial* and Resolve* functions.

Is there anyone working ATM to improve this situation, or do we at
least have a plan on how to do so? Looking at net.Dialer, perhaps the
plan was to have other methods available there, but we never had the
time to do it?


gustavo @ http://niemeyer.net

Brad Fitzpatrick

unread,
Sep 3, 2013, 11:35:55 AM9/3/13
to Gustavo Niemeyer, golang-dev
net.Dialer is a superset of all the Dial* funcs.

So what do you actually want? To Resolve* with a timeout efficiently?

I would be fine with a net.Dialer.Resolve method, but it's passed the deadline.  File an issue?




--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Brad Fitzpatrick

unread,
Sep 3, 2013, 11:36:24 AM9/3/13
to Gustavo Niemeyer, golang-dev
s/passed/past/  Nice.

Gustavo Niemeyer

unread,
Sep 3, 2013, 12:59:53 PM9/3/13
to Brad Fitzpatrick, golang-dev
On Tue, Sep 3, 2013 at 12:35 PM, Brad Fitzpatrick <brad...@golang.org> wrote:
> net.Dialer is a superset of all the Dial* funcs.

That's not quite true. If one has a net.TCPAddr, there's no way to
dial it other than stringifying and submitting it to the
parser/resolver again.

> So what do you actually want? To Resolve* with a timeout efficiently?

Right, and DialTCP.

> I would be fine with a net.Dialer.Resolve method, but it's passed the
> deadline. File an issue?

Will do, thanks.


gustavo @ http://niemeyer.net

Brad Fitzpatrick

unread,
Sep 3, 2013, 1:25:30 PM9/3/13
to Gustavo Niemeyer, golang-dev

A stringified TCPAddr won't re-resolve though.

But if it really matters, we could have a DialAddr method on Dialer.

Gustavo Niemeyer

unread,
Sep 5, 2013, 11:32:32 PM9/5/13
to Brad Fitzpatrick, golang-dev
Reply all
Reply to author
Forward
0 new messages