[#1422] node: Use dialer source for SDK cache
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
74db735265
commit
6c96cc2af6
4 changed files with 22 additions and 12 deletions
|
@ -13,6 +13,10 @@ type Dialer interface {
|
|||
DialContext(ctx context.Context, network, address string) (net.Conn, error)
|
||||
}
|
||||
|
||||
func DialContextTCP(ctx context.Context, address string, d Dialer) (net.Conn, error) {
|
||||
return d.DialContext(ctx, "tcp", address)
|
||||
}
|
||||
|
||||
func newDefaulDialer() net.Dialer {
|
||||
// From `grpc.WithContextDialer` comment:
|
||||
//
|
||||
|
@ -28,7 +32,7 @@ func newDefaulDialer() net.Dialer {
|
|||
KeepAlive: time.Duration(-1),
|
||||
Control: func(_, _ string, c syscall.RawConn) error {
|
||||
return c.Control(func(fd uintptr) {
|
||||
unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_KEEPALIVE, 1)
|
||||
_ = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_KEEPALIVE, 1)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue