From e44e03da84278997e019b531fb89068d918f3db4 Mon Sep 17 00:00:00 2001 From: xc Date: Thu, 18 Sep 2025 18:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2grpc.dial=20=E4=B8=BAgrpc.New?= =?UTF-8?q?Client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scagent/core/FileRpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index 014e8f1..26cc96d 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -167,7 +167,7 @@ func clientUploadFile(remote string, filePath string, uploadPath string) error { // 连接到服务器 service := fmt.Sprintf("%v:%v", dstip, dport) fmt.Printf("service: %s\n", service) - conn, err := grpc.Dial(service, grpc.WithTransportCredentials(insecure.NewCredentials())) // 使用安全连接 + conn, err := grpc.NewClient(service, grpc.WithTransportCredentials(insecure.NewCredentials())) // 使用安全连接 // conn, err := grpc.NewClient(service) if err != nil { logger.Error("clientUploadFile", zap.String("msg", "无法连接到服务器"), zap.Error(err))