diff --git a/dial.go b/dial.go index 2c5e712..0f0973a 100644 --- a/dial.go +++ b/dial.go @@ -5,10 +5,9 @@ import ( "github.com/injoyai/ios" "net" "strings" - "time" ) -func NewHostDial(hosts []string, timeout time.Duration) ios.DialFunc { +func NewHostDial(hosts []string) ios.DialFunc { if len(hosts) == 0 { hosts = Hosts } @@ -23,7 +22,7 @@ func NewHostDial(hosts []string, timeout time.Duration) ios.DialFunc { if !strings.Contains(addr, ":") { addr += ":7709" } - c, err := net.DialTimeout("tcp", addr, timeout) + c, err := net.Dial("tcp", addr) return c, hosts[index], err } } diff --git a/example/common/common.go b/example/common/common.go index 30651fa..44a2976 100644 --- a/example/common/common.go +++ b/example/common/common.go @@ -8,7 +8,7 @@ import ( func Test(f func(c *tdx.Client)) { //重连方式1,优点,同一个客户端指针 - c, err := tdx.DialWith(tdx.NewHostDial(tdx.Hosts, 0), tdx.WithDebug()) + c, err := tdx.DialWith(tdx.NewHostDial(tdx.Hosts), tdx.WithDebug()) logs.PanicErr(err) f(c) <-c.Done()