Browse Source

替换grpc.dial 为grpc.NewClient

master
xyiege 4 months ago
parent
commit
e44e03da84
  1. 2
      scagent/core/FileRpc.go

2
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))

Loading…
Cancel
Save