replace deprecated Dail with DailContext
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
This commit is contained in:
parent
61a46e9fdd
commit
8e850bc0fe
@ -77,7 +77,9 @@ func SocketAddress(ctx context.Context, socketPath, id string) (string, error) {
|
||||
|
||||
// AnonDialer returns a dialer for a socket
|
||||
func AnonDialer(address string, timeout time.Duration) (net.Conn, error) {
|
||||
return dialer.Dialer(socket(address).path(), timeout)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
return dialer.ContextDialer(ctx, socket(address).path())
|
||||
}
|
||||
|
||||
// AnonReconnectDialer returns a dialer for an existing socket on reconnection
|
||||
|
Loading…
Reference in New Issue
Block a user