1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

add DialContext to yamux transport

This commit is contained in:
Roman Khafizianov 2024-10-11 09:34:53 +02:00
parent 7896963d6d
commit a11728fb25
No known key found for this signature in database
GPG key ID: F07A7D55A2684852

View file

@ -104,7 +104,8 @@ func (y *yamuxTransport) AddListener(lis net.Listener) {
func (y *yamuxTransport) Dial(ctx context.Context, addr string) (mc transport.MultiConn, err error) {
dialTimeout := time.Duration(y.conf.DialTimeoutSec) * time.Second
conn, err := net.DialTimeout("tcp", addr, dialTimeout)
dialer := &net.Dialer{Timeout: dialTimeout}
conn, err := dialer.DialContext(ctx, "tcp", addr)
if err != nil {
return nil, err
}