|
|
@@ -99,7 +99,7 @@ type ConnConfig struct {
|
|
|
CQLVersion string
|
|
|
Timeout time.Duration
|
|
|
ConnectTimeout time.Duration
|
|
|
- Dialer *net.Dialer
|
|
|
+ Dialer Dialer
|
|
|
Compressor Compressor
|
|
|
Authenticator Authenticator
|
|
|
AuthProvider func(h *HostInfo) (Authenticator, error)
|
|
|
@@ -203,14 +203,15 @@ func (s *Session) dialWithoutObserver(ctx context.Context, host *HostInfo, cfg *
|
|
|
|
|
|
dialer := cfg.Dialer
|
|
|
if dialer == nil {
|
|
|
- dialer = &net.Dialer{
|
|
|
+ d := &net.Dialer{
|
|
|
Timeout: cfg.ConnectTimeout,
|
|
|
}
|
|
|
+ if cfg.Keepalive > 0 {
|
|
|
+ d.KeepAlive = cfg.Keepalive
|
|
|
+ }
|
|
|
+ dialer = d
|
|
|
}
|
|
|
|
|
|
- if cfg.Keepalive > 0 {
|
|
|
- dialer.KeepAlive = cfg.Keepalive
|
|
|
- }
|
|
|
|
|
|
conn, err := dialer.DialContext(ctx, "tcp", host.HostnameAndPort())
|
|
|
if err != nil {
|