wsservice

package
v0.0.0-...-ff803ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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 WSClient

type WSClient struct {
	// contains filtered or unexported fields
}

func (*WSClient) GetId

func (slf *WSClient) GetId() uint64

func (*WSClient) OnClose

func (slf *WSClient) OnClose()

func (*WSClient) Run

func (slf *WSClient) Run()

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

type WSService struct {
	service.Service
	// contains filtered or unexported fields
}

func (*WSService) Close

func (ws *WSService) Close(clientid uint64)

func (*WSService) NewWSClient

func (ws *WSService) NewWSClient(conn *network.WSConn) network.Agent

func (*WSService) OnInit

func (ws *WSService) OnInit() error

func (*WSService) SendMsg

func (ws *WSService) SendMsg(clientid uint64, msg interface{}) error

func (*WSService) SetProcessor

func (ws *WSService) SetProcessor(process processor.IProcessor, handler event.IEventHandler)

func (*WSService) WSEventHandler

func (ws *WSService) WSEventHandler(ev *event.Event)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL