Skip to content

Commit

Permalink
chore(net): move defaultKeepAliveConfig()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Dec 6, 2024
1 parent 7568045 commit 4440c9e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions net.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ func DialRedirectFromHostPortPairs(subs []HostPortPair) DialRedirectFunc {
}
}

// defaultKeepAliveConfig returns configuration that enables keep-alive pings with OS-specific parameters.
func defaultKeepAliveConfig() net.KeepAliveConfig {
return net.KeepAliveConfig{
Enable: true,
Idle: -1,
Interval: -1,
Count: -1,
}
}

type DialRetryConfig struct {
Attempts int
Backoff time.Duration
Expand Down Expand Up @@ -94,6 +84,16 @@ func DefaultDialConfig() *DialConfig {
}
}

// defaultKeepAliveConfig returns configuration that enables keep-alive pings with OS-specific parameters.
func defaultKeepAliveConfig() net.KeepAliveConfig {
return net.KeepAliveConfig{
Enable: true,
Idle: -1,
Interval: -1,
Count: -1,
}
}

type dialContextFunc func(ctx context.Context, network, address string) (net.Conn, error)

type Dialer struct {
Expand Down

0 comments on commit 4440c9e

Please sign in to comment.