From c0431fa2f1bf7a433328ef2dce96e104cce11a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Fri, 15 Dec 2023 23:46:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=80=E5=A4=A7=E8=AF=BB=E5=8F=96200?= =?UTF-8?q?m=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/worker/connect.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/module/worker/connect.go b/module/worker/connect.go index eac4fc5a..53a7e0a4 100644 --- a/module/worker/connect.go +++ b/module/worker/connect.go @@ -25,31 +25,31 @@ func Connect() error { url := args.Worker.Remote hostname, _ := os.Hostname() // 获取主机名 - pod, err := socket.NewWsClient(url, "", "tdp://"+hostname) - + conn, err := socket.NewWsClient(url, "", "tdp://"+hostname) if err != nil { return err } - defer pod.Close() + conn.MaxPayloadBytes = 200 << 20 // 200M + defer conn.Close() // 注册节点 - send := &SendPod{pod} + send := &SendPod{conn} go send.Register() // 接收数据 - return Receiver(pod) + return Receiver(conn) } -func Receiver(pod *socket.WsConn) error { +func Receiver(conn *socket.WsConn) error { - recv := &RecvPod{pod} - resp := &RespPod{pod} + recv := &RecvPod{conn} + resp := &RespPod{conn} for { var rq *socket.PlainData - if err := pod.ReadJson(&rq); err != nil { + if err := conn.ReadJson(&rq); err != nil { logman.Error("read json failed", "error", err) return err }