ztcpclient

package
v0.0.0-...-a0ddb2b Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CMaxResultRetry = 10

Variables

View Source
var Result ztcputil.ConcurrentMap // [CMaxResultBuffer]*[]byte
View Source
var ResultIndex ztcputil.Count32

Functions

func BenchTicket

func BenchTicket(tcpClients *MultiClient)

func ClientStart

func ClientStart(addr string)

func GetGroupMessageID

func GetGroupMessageID(msg []byte) string

Types

type Command

type Command int
const (
	MessageNew Command = iota
	MessageEdit
	MessageBroadcast
)

func (Command) String

func (s Command) String() string

func (Command) Toa

func (s Command) Toa() string

type MultiClient

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

func MultiClientCreate

func MultiClientCreate(addr string) *MultiClient

func (*MultiClient) Get

func (s *MultiClient) Get() *TcpClient

func (*MultiClient) GetMessage

func (s *MultiClient) GetMessage(key string) []byte

func (*MultiClient) GetViaCpu

func (s *MultiClient) GetViaCpu(cpu int) *TcpClient

func (*MultiClient) SendMessage

func (s *MultiClient) SendMessage(msg string) string

func (*MultiClient) SendMessageViaCpu

func (s *MultiClient) SendMessageViaCpu(msg string, cpu int) string

type TcpClient

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

func NewTcpClient

func NewTcpClient(addr string) *TcpClient

func (*TcpClient) GetMessage

func (s *TcpClient) GetMessage(key string) []byte

func (*TcpClient) SendBinary

func (s *TcpClient) SendBinary(data []byte)

func (*TcpClient) SendMessage

func (s *TcpClient) SendMessage(msgstr string) string

func (*TcpClient) SendMessageEncode

func (s *TcpClient) SendMessageEncode(m interface{}) uint64

Jump to

Keyboard shortcuts

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