Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerWrap ¶
HandlerWrap gev Handler wrap
func NewHandlerWrap ¶
func NewHandlerWrap(u *ws.Upgrader, wsHandler WSHandler) *HandlerWrap
NewHandlerWrap websocket handler wrap
func (*HandlerWrap) OnConnect ¶
func (s *HandlerWrap) OnConnect(c *connection.Connection)
OnConnect wrap
func (*HandlerWrap) OnMessage ¶
func (s *HandlerWrap) OnMessage(c *connection.Connection, ctx interface{}, payload []byte) []byte
OnMessage wrap
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
Protocol websocket
func (*Protocol) Packet ¶
func (p *Protocol) Packet(c *connection.Connection, data []byte) []byte
Packet 直接返回
func (*Protocol) UnPacket ¶
func (p *Protocol) UnPacket(c *connection.Connection, buffer *ringbuffer.RingBuffer) (ctx interface{}, out []byte)
UnPacket 解析 websocket 协议,返回 header ,payload
type WSHandler ¶
type WSHandler interface { OnConnect(c *connection.Connection) OnMessage(c *connection.Connection, msg []byte) (ws.MessageType, []byte) OnClose(c *connection.Connection) }
WSHandler WebSocket Server 注册接口
Click to show internal directories.
Click to hide internal directories.