76
77
contextDialer := func(ctx context.Context, s string) (net.Conn, error) {
78
>
// Keep the existing gRPC behavior by using OS defaults for TCP keepalive settings.
grpc.go
79
>
// We are on Go 1.23+ and can use KeepAliveConfig directly instead of the old KeepAlive/Control hacks.
80
>
dialer := &net.Dialer{
81
>
KeepAliveConfig: net.KeepAliveConfig{
82
>
Enable: true,
83
>
},
84
>
}
85
>
86
>
var ndt *networkDialTrace
87
>
ctx, ndt = dtrace.beginNetworkDial(ctx)
88
>
conn, dialErr := dialer.DialContext(ctx, "tcp", s)
89
>
dtrace.endNetworkDial(ndt, dialErr)
90
>
return conn, dialErr
91
>
}
92
93
dialOptions := []grpc.DialOption{