Documentation ¶
Overview ¶
Package rrdialer implements a dialer which provides improved behaviour for hostnames with multiple IP addresses (aka. round-robin DNS).
Unlike the default net.Dialer which divides the timeout between the multiple endpoints (IP addresses), the round-robin dialer tracks the historic performance of each endpoint to dial the fastest endpoint first and will concurrently dial other endpoints if unusually long connection times are observed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new Dialer. The underlying raw dialer used to dial each endpoint is given by dialer. The directory in which endpoint statitics are written is given by cacheDir. If this is the empty string then the ".cache" subdirectory of the home directory is used. Log messages are written to logger. If the debug level is 3 or greater then all endpoints are dialed.
func (*Dialer) DialContext ¶
DialContext connects to the address on the named network using the provided context.
func (*Dialer) WaitForBackgroundResults ¶
WaitForBackgroundResults will wait up to timeout for other endpoint connection attempts to complete, so that their performance statistics can be saved. It is recommended to call this just before the main function returns.