Change conn.ReadPacket for reuse of the buffer

This commit is contained in:
Tnze
2021-02-25 14:24:28 +08:00
parent 5feb25895e
commit 27a30efe7b
8 changed files with 48 additions and 58 deletions

View File

@ -81,7 +81,7 @@ Then you can send it to server using `conn.WritePacket(p)`. The `conn` is a `net
Receiving packet is quite easy too. To read a packet, call `p.Scan()` like this:
接收包也非常简单,只要调用`conn.ReadPacket()`即可。而要读取包内数据则需要使用`p.Scan()`函数,就像这样:
接收包也非常简单,只要调用`conn.ReadPacket(&p)`即可。而要读取包内数据则需要使用`p.Scan()`函数,就像这样:
```go
var (