View definition

func DialDualStackTimeout

Defined in


DialDualStackTimeout dials the given TCP addr using both tcp4 and tcp6 using the given timeout.

This function has the following additional features comparing to net.Dial:

* It reduces load on DNS resolver by caching resolved TCP addressed
  for DefaultDNSCacheDuration.
* It dials all the resolved TCP addresses in round-robin manner until
  connection is established. This may be useful if certain addresses
  are temporarily unreachable.

This dialer is intended for custom code wrapping before passing to Client.Dial or HostClient.Dial.

For instance, per-host counters and/or limits may be implemented by such wrappers.

The addr passed to the function must contain port. Example addr values:

* foobar.baz:443

DialDualStackTimeout is referenced in 0 repositories