kcpmodule

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) OnClose

func (c *Client) OnClose()

func (*Client) Run

func (c *Client) Run()

type KcpModule

type KcpModule struct {
	service.Module
	// contains filtered or unexported fields
}

func (*KcpModule) Close

func (km *KcpModule) Close(clientId string)

func (*KcpModule) GetClientIp

func (km *KcpModule) GetClientIp(clientId string) string

func (*KcpModule) GetProcessor

func (km *KcpModule) GetProcessor() processor.IRawProcessor

func (*KcpModule) Init

func (km *KcpModule) Init(kcpCfg *network.KcpCfg, process processor.IRawProcessor)

func (*KcpModule) NewAgent

func (km *KcpModule) NewAgent(conn network.Conn) network.Agent

func (*KcpModule) OnClose

func (km *KcpModule) OnClose(c *Client)

func (*KcpModule) OnConnected

func (km *KcpModule) OnConnected(c *Client)

func (*KcpModule) OnInit

func (km *KcpModule) OnInit() error

func (*KcpModule) SendRawMsg

func (km *KcpModule) SendRawMsg(clientId string, data []byte) error

func (*KcpModule) SetBlob

func (km *KcpModule) SetBlob(blockCrypt kcp.BlockCrypt)

func (*KcpModule) Start

func (km *KcpModule) Start() error

type KcpPack

type KcpPack struct {
	Type                KcpPackType //0表示连接 1表示断开 2表示数据
	ClientId            string
	Data                interface{}
	RecyclerReaderBytes func(data []byte)
}

type KcpPackType

type KcpPackType int8
const (
	KPTConnected    KcpPackType = 0
	KPTDisConnected KcpPackType = 1
	KPTPack         KcpPackType = 2
	KPTUnknownPack  KcpPackType = 3
)

Jump to

Keyboard shortcuts

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