From 1761d52c4043afdd2e0e7a012ae6d95eed4f2abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=80=9D=E6=95=8F?= Date: Thu, 1 Sep 2022 15:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0TAP=E6=B5=8B=E8=AF=95(TODO=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90arp)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc_client.go | 2 +- utils.go | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/rpc_client.go b/rpc_client.go index 2c6fb16..8725c90 100644 --- a/rpc_client.go +++ b/rpc_client.go @@ -99,7 +99,7 @@ func (cli *RPCClient) run() { } defer stream.CloseSend() - var ticker = time.NewTicker(time.Millisecond * 200) + var ticker = time.NewTicker(time.Millisecond * 1) buf := bytes.NewBuffer(nil) for { diff --git a/utils.go b/utils.go index 7964471..eb4e004 100644 --- a/utils.go +++ b/utils.go @@ -7,8 +7,6 @@ import ( "io" "log" "net" - - "github.com/klauspost/compress/zstd" ) func Compress(writer io.Writer, data [][]byte) { @@ -22,14 +20,14 @@ func Compress(writer io.Writer, data [][]byte) { } // zstd compress - zenc, err := zstd.NewWriter(writer) - if err != nil { - log.Panic(err) - } - err = zenc.Flush() - if err != nil { - log.Println(err) - } + // zenc, err := zstd.NewWriter(writer) + // if err != nil { + // log.Panic(err) + // } + // err = zenc.Flush() + // if err != nil { + // log.Println(err) + // } } @@ -37,12 +35,12 @@ func Decompress(data []byte) (frames [][]byte) { var err error var buf = bytes.NewBuffer(data) - var zdec *zstd.Decoder - zdec, err = zstd.NewReader(buf) - if err != nil { - log.Panic(err) - } - zdec.Close() + // var zdec *zstd.Decoder + // zdec, err = zstd.NewReader(buf) + // if err != nil { + // log.Panic(err) + // } + // zdec.Close() dec := gob.NewDecoder(buf) err = dec.Decode(&frames)