client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 9 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 {
	Exit chan struct{}

	Topic string

	Id uint32

	//有缓冲管道,用于读、写两个goroutine之间的消息通信
	In chan common.IMessage

	Packet common.Packet
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *plugin.PluginCfg, Topic string, handleMsg func(msg plugin.IMessage)) (c *Client)

func (*Client) ConnectWithTimeOut

func (c *Client) ConnectWithTimeOut(timeout int) (err error)

func (*Client) SendBuffMsg

func (client *Client) SendBuffMsg(msgID uint32, ctr byte, data []byte) error

SendBuffMsg 发生BuffMsg

func (*Client) SendMsg

func (client *Client) SendMsg(msgID uint32, ctr byte, data []byte) error

SendMsg 直接将Message数据发送数据给远程的TCP客户端

func (*Client) SendTopicMsg

func (c *Client) SendTopicMsg(id uint32, msg *common.TopMessage) error

func (*Client) SendTopicMsgDirect

func (c *Client) SendTopicMsgDirect(id uint32, msg *common.TopMessage) error

func (*Client) Start

func (c *Client) Start() error

func (*Client) Stop

func (client *Client) Stop()

Jump to

Keyboard shortcuts

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