client

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientContext

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

func LinkLongConn

func LinkLongConn(name, ip, port, key string) (*ClientContext, error)

func (*ClientContext) Close

func (c *ClientContext) Close()

func (*ClientContext) GetOtherDelayPing

func (c *ClientContext) GetOtherDelayPing(name ...string) ([]tool.OdjPing, error)

func (*ClientContext) GetSubConn

func (c *ClientContext) GetSubConn(name string) (*SubConnContext, error)

func (*ClientContext) ListenSubConn

func (c *ClientContext) ListenSubConn(fn func(sub *SubConnContext)) error

func (*ClientContext) ListenSubConnReadWriter added in v1.2.0

func (c *ClientContext) ListenSubConnReadWriter(fn func(sub *SubConnContext)) error

func (*ClientContext) ListenSubConnWriter added in v1.2.0

func (c *ClientContext) ListenSubConnWriter(fn func(sub *SubConnContext)) error

type SubConnContext

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

func (*SubConnContext) Close

func (s *SubConnContext) Close()

func (*SubConnContext) GetConn

func (s *SubConnContext) GetConn() net.Conn

func (*SubConnContext) NewKey added in v1.2.0

func (s *SubConnContext) NewKey(key string) tool.Key

func (*SubConnContext) NewSubConnReader added in v1.2.0

func (s *SubConnContext) NewSubConnReader()

NewSubConnReader new reader

func (*SubConnContext) Read added in v1.2.0

func (s *SubConnContext) Read(fn func(cMsg tool.ConnMsg) bool) error

Read, This is according to the CFC custom protocol to read content, if you want to use this protocol communication, then you write content should also follow the protocol, the callback return false will stop reading, If you don't have ListenSubConnReadWriter/NewSubConnReader please don't use it (because did not create objects)

func (*SubConnContext) Write added in v1.2.0

func (s *SubConnContext) Write(b []byte)

Write, This is the case where conn writes to the data race, it will be written in FIFO order. If you are using ListenSubConn/GetSubConn, please do not use this method. It does not support (and does not create objects)

Jump to

Keyboard shortcuts

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