dial timeout

This commit is contained in:
Sergey Cherepanov 2023-02-14 19:39:57 +03:00
parent 00dc0bcca6
commit 4cde54bdb3
No known key found for this signature in database
GPG Key ID: 87F8EDE8FBDF637C

View File

@ -100,7 +100,7 @@ func (d *dialer) Dial(ctx context.Context, peerId string) (p peer.Peer, err erro
}
func (d *dialer) handshake(ctx context.Context, addr string) (conn drpc.Conn, sc sec.SecureConn, err error) {
tcpConn, err := net.Dial("tcp", addr)
tcpConn, err := net.DialTimeout("tcp", addr, time.Second)
if err != nil {
return
}