mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
23 lines
388 B
Go
23 lines
388 B
Go
package transport
|
|
|
|
import (
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
type rwTimeoutDialer struct {
|
|
wtimeoutd time.Duration
|
|
rdtimeoutd time.Duration
|
|
net.Dialer
|
|
}
|
|
|
|
func (d *rwTimeoutDialer) Dial(network, address string) (net.Conn, error) {
|
|
conn, err := d.Dialer.Dial(network, address)
|
|
tconn := &timeoutConn{
|
|
rdtimeoutd: d.rdtimeoutd,
|
|
wtimeoutd: d.wtimeoutd,
|
|
Conn: conn,
|
|
}
|
|
return tconn, err
|
|
}
|