Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alberliu committed May 7, 2022
1 parent 2e8eb07 commit 443fea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (d *headerLenDecoder) Decode(c *Conn) error {
return nil
}

c.server.handler.OnMessage(c, body)
c.OnMessage(body)
}
}

Expand Down
5 changes: 5 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func (c *Conn) CloseRead() error {
return nil
}

// OnMessage 消息处理
func (c *Conn) OnMessage(bytes []byte) {
c.server.handler.OnMessage(c, bytes)
}

// GetData 获取数据
func (c *Conn) GetData() interface{} {
return c.data
Expand Down

0 comments on commit 443fea1

Please sign in to comment.