Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
lim-yoona committed Oct 13, 2023
1 parent 425a220 commit 55122ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ package main
import "github.com/lim-yoona/tcpack"

func main() {
// Create a packager
mp := tcpack.NewMsgPack(8, tcpConn)
// 创建一个打包器
mp := tcpack.NewMsgPack(8, tcpConn)

// Pack and send a message
msg := tcpack.NewMessage(0, uint32(len([]byte(data))), []byte(data))
// 打包一个消息并发送
msg := tcpack.NewMessage(0, uint32(len([]byte(data))), []byte(data))
num, err := mp.Pack(msg)

// Unpack and receive a message
msg, err := mp.Unpack()
// 解包一个消息并接收
msg, err := mp.Unpack()
}
```

Expand Down

0 comments on commit 55122ac

Please sign in to comment.