Documentation
¶
Index ¶
- Variables
- type DialWrap
- func (d *DialWrap) Address() (string, string)
- func (d *DialWrap) DialContext(ctx context.Context, _ string, _ string) (net.Conn, error)
- func (d *DialWrap) FirstConnectionTook() time.Duration
- func (d *DialWrap) MultipathTCP() bool
- func (d *DialWrap) SetFirstConnectionDuration(dur time.Duration)
- func (d *DialWrap) SetMultipathTCP(use bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // errGotConnection has already been established ErrInflightCancel = errkit.New("context cancelled before establishing connection") ErrNoIPs = errkit.New("no ips provided in dialWrap") ExpireConnAfter = time.Duration(5) * time.Second ErrPortClosedOrFiltered = errkit.New("port closed or filtered").SetKind(errkit.ErrKindNetworkPermanent) )
Error constants
Functions ¶
This section is empty.
Types ¶
type DialWrap ¶
type DialWrap struct {
// contains filtered or unexported fields
}
DialWrap wraps the net dialer taking in and only dials to given ips. This implementation retains the orignal Happy Eyeballs algorithm and dual stack support.
func NewDialWrap ¶
func NewDialWrap(dialer *net.Dialer, ips []string, network, address, port string) (*DialWrap, error)
NewDialWrap creates a new dial wrap instance and returns it.
func (*DialWrap) Address ¶
Address returns ip and port of the target if multiple ips are present, it returns the first one
func (*DialWrap) DialContext ¶
DialContext is the main entry point for dialing
func (*DialWrap) FirstConnectionTook ¶ added in v0.2.13
func (*DialWrap) MultipathTCP ¶
MultipathTCP is a getter for the MultipathTCP field
func (*DialWrap) SetFirstConnectionDuration ¶ added in v0.2.13
func (*DialWrap) SetMultipathTCP ¶
SetMultipathTCP is a setter for the MultipathTCP field
Click to show internal directories.
Click to hide internal directories.