From b4f748306a58553938620869b236f6e468b63c34 Mon Sep 17 00:00:00 2001 From: injoyai <1113655791@qq.com> Date: Tue, 18 Mar 2025 15:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96NewRangeDial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dial.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dial.go b/dial.go index affc034..cbb53df 100644 --- a/dial.go +++ b/dial.go @@ -51,6 +51,11 @@ func NewRangeDial(hosts []string) ios.DialFunc { } return func(ctx context.Context) (c ios.ReadWriteCloser, _ string, err error) { for i, addr := range hosts { + select { + case <-ctx.Done(): + return nil, "", ctx.Err() + default: + } if !strings.Contains(addr, ":") { addr += ":7709" }