Skip to content

Commit

Permalink
修改文档
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong committed Sep 22, 2023
1 parent 52687c9 commit a155f37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (h *handler) OnOpen(c *quickws.Conn) {

func (h *handler) OnMessage(c *quickws.Conn, op quickws.Opcode, msg []byte) {
// 如果msg的生命周期不是在OnMessage中结束,需要拷贝一份
// newMsg := makc([]byte, len(msg))
// newMsg := make([]byte, len(msg))
// copy(newMsg, msg)

fmt.Printf("收到客户端消息:%s\n", msg)
Expand Down Expand Up @@ -148,7 +148,7 @@ func (h *handler) OnOpen(c *quickws.Conn) {

func (h *handler) OnMessage(c *quickws.Conn, op quickws.Opcode, msg []byte) {
// 如果msg的生命周期不是在OnMessage中结束,需要拷贝一份
// newMsg := makc([]byte, len(msg))
// newMsg := make([]byte, len(msg))
// copy(newMsg, msg)

fmt.Printf("收到服务端消息:%s\n", msg)
Expand Down

0 comments on commit a155f37

Please sign in to comment.