client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 6 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 {
	Conn net.Conn
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn net.Conn, readLimit int, sendLimit int, heart time.Duration) *Client

NewClient 新客户端 conn 连接协议实例 readLimit 最大读取包 sendLimit 最大写入包 heart 心跳周期

func (*Client) Close

func (c *Client) Close()

Close 关闭服务

func (*Client) KeepAlive

func (c *Client) KeepAlive(interval time.Duration)

KeepAlive 保持心跳

func (*Client) Ping

func (c *Client) Ping()

Ping 发送心跳

func (*Client) Receive

func (c *Client) Receive() <-chan gameapi.Packet

Receive 读取消息

func (*Client) Send

func (c *Client) Send(opcode uint16, msg protoreflect.ProtoMessage) error

Send 发送消息

Jump to

Keyboard shortcuts

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