From 4d8d9f1ad9e18e83670426a2666b653ce3c07973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E7=BA=AF=E5=87=80?= <1113655791@qq.com> Date: Wed, 12 Mar 2025 22:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=87=BD=E6=95=B0DialHostsRa?= =?UTF-8?q?ndom,=E9=9A=8F=E6=9C=BA=E8=BF=9E=E6=8E=A5=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9A=84ip=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index 1f684e1..11f30a8 100644 --- a/client.go +++ b/client.go @@ -48,6 +48,11 @@ func DialHosts(hosts []string, op ...client.Option) (cli *Client, err error) { return DialWith(NewHostDial(hosts), op...) } +// DialHostsRandom 与服务器建立连接,多个服务器随机连接 +func DialHostsRandom(hosts []string, op ...client.Option) (cli *Client, err error) { + return DialWith(NewRandomDial(hosts), op...) +} + // DialWith 与服务器建立连接 func DialWith(dial ios.DialFunc, op ...client.Option) (cli *Client, err error) {