This commit is contained in:
黄思敏 2022-08-26 10:53:35 +08:00
parent 8042a498fe
commit 10c5e7779d

View File

@ -79,14 +79,17 @@ func (cli *RPCClient) run() {
// encode gob
enc := gob.NewEncoder(buf)
cliBuffer := <-cli.FrameChan
enc.Encode(cliBuffer.BytesArray)
err := enc.Encode(cliBuffer.BytesArray)
if err != nil {
log.Panic(err)
}
// zstd compress
zenc, err := zstd.NewWriter(buf)
if err != nil {
log.Panic(err)
}
err = zenc.Close()
err = zenc.Flush()
if err != nil {
log.Println(err)
}