kcpmodule

package
v2.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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