Documentation ¶
Index ¶
- Constants
- Variables
- type Conn
- type Group
- func (group *Group) AddConn(conn *Conn)
- func (group *Group) AddMuxWS(muxWS *MuxWebSocket) (err error)
- func (group *Group) DeleteConn(id uint32)
- func (group *Group) GetConn(id uint32) (conn *Conn)
- func (group *Group) Handle(m *Message)
- func (group *Group) Listen(muxWS *MuxWebSocket)
- func (group *Group) NewMuxConn(host string) (conn *Conn, err error)
- func (group *Group) NextConnID() (id uint32)
- func (group *Group) Send(m *Message) (err error)
- func (group *Group) ServerHandleMessage(m *Message) (err error)
- type Message
- type MuxWebSocket
Constants ¶
View Source
const ( MessageMethodData = iota MessageMethodDial )
Variables ¶
View Source
var ErrConnClosed = errors.New("mux conn closed")
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { ID uint32 // contains filtered or unexported fields }
func (*Conn) HandleMessage ¶
func (*Conn) SendMessageID ¶
type Group ¶
type Group struct { MuxWSs []*MuxWebSocket // contains filtered or unexported fields }
func (*Group) AddMuxWS ¶
func (group *Group) AddMuxWS(muxWS *MuxWebSocket) (err error)
func (*Group) DeleteConn ¶ added in v0.15.1
func (*Group) Listen ¶
func (group *Group) Listen(muxWS *MuxWebSocket)
func (*Group) NewMuxConn ¶
NewMuxConn creates a new mux connection for client
func (*Group) NextConnID ¶ added in v0.15.1
func (*Group) ServerHandleMessage ¶
ServerHandleMessage is a server group function
type Message ¶
type Message struct { Method uint8 ConnID uint32 MessageID uint32 Length uint32 Data []byte // contains filtered or unexported fields }
MessageHeadLength = 13
func LoadMessage ¶
type MuxWebSocket ¶
func NewMuxWebSocket ¶
func NewMuxWebSocket(ws *core.WebSocket) (muxWS *MuxWebSocket)
func (*MuxWebSocket) Close ¶ added in v0.15.1
func (muxWS *MuxWebSocket) Close() (err error)
func (*MuxWebSocket) Receive ¶
func (muxWS *MuxWebSocket) Receive() (m *Message, err error)
func (*MuxWebSocket) Send ¶
func (muxWS *MuxWebSocket) Send(m *Message) (err error)
Click to show internal directories.
Click to hide internal directories.