Skip to content

Commit

Permalink
add BuiltinEventEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
lixizan committed Feb 3, 2023
1 parent e666ae0 commit 55b57d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,17 @@ type Event interface {
OnPong(socket *Conn, payload []byte)
OnMessage(socket *Conn, message *Message)
}

type BuiltinEventEngine struct{}

func (b BuiltinEventEngine) OnOpen(socket *Conn) {}

func (b BuiltinEventEngine) OnError(socket *Conn, err error) {}

func (b BuiltinEventEngine) OnClose(socket *Conn, code uint16, reason []byte) {}

func (b BuiltinEventEngine) OnPing(socket *Conn, payload []byte) {}

func (b BuiltinEventEngine) OnPong(socket *Conn, payload []byte) {}

func (b BuiltinEventEngine) OnMessage(socket *Conn, message *Message) {}

0 comments on commit 55b57d0

Please sign in to comment.