Documentation ¶
Index ¶
- Constants
- type WSClient
- type WSPack
- type WSPackType
- type WSService
- func (ws *WSService) Close(clientid uint64)
- func (ws *WSService) NewWSClient(conn *network.WSConn) network.Agent
- func (ws *WSService) OnInit() error
- func (ws *WSService) SendMsg(clientid uint64, msg interface{}) error
- func (ws *WSService) SetMessageType(messageType int)
- func (ws *WSService) SetProcessor(process processor.IProcessor, handler event.IEventHandler)
- func (ws *WSService) WSEventHandler(ev event.IEvent)
Constants ¶
View Source
const ( MaxNodeId = 1<<14 - 1 //最大值 16383 MaxSeed = 1<<19 - 1 //最大值 524287 MaxTime = 1<<31 - 1 //最大值 2147483647 )
View Source
const Default_WS_MaxConnNum = 3000
View Source
const Default_WS_MaxMsgLen = 65535
View Source
const Default_WS_PendingWriteNum = 10000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WSPack ¶
type WSPack struct { Type WSPackType //0表示连接 1表示断开 2表示数据 MsgProcessor processor.IProcessor ClientId uint64 Data interface{} }
type WSPackType ¶
type WSPackType int8
const ( WPT_Connected WSPackType = 0 WPT_DisConnected WSPackType = 1 WPT_Pack WSPackType = 2 WPT_UnknownPack WSPackType = 3 )
type WSService ¶
func (*WSService) NewWSClient ¶
func (*WSService) SetMessageType ¶ added in v1.17.5
func (*WSService) SetProcessor ¶
func (ws *WSService) SetProcessor(process processor.IProcessor, handler event.IEventHandler)
func (*WSService) WSEventHandler ¶
Click to show internal directories.
Click to hide internal directories.