新TAP测试(TODO 解析arp)

This commit is contained in:
黄思敏 2022-09-01 15:43:38 +08:00
parent cd60823d65
commit 1761d52c40
2 changed files with 15 additions and 17 deletions

View File

@ -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 {

View File

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