paconn

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_SEND_TIMEOUT time.Duration = time.Millisecond * 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(
	c net.Conn,
	readto time.Duration,
	heart time.Duration,
	onenotify FunAgOnewaynotify,
	twonotify FunAgTwowaynotify,
	close FunAgClose,
) *Agent

func NewAgentFromAddr

func NewAgentFromAddr(addr string,
	readtimeout time.Duration,
	heart time.Duration,
	onenotify FunAgOnewaynotify,
	twonotify FunAgTwowaynotify,
	close FunAgClose,
) (*Agent, error)

func (*Agent) Close

func (m *Agent) Close()

func (*Agent) Id

func (m *Agent) Id() string

func (*Agent) Oneway

func (m *Agent) Oneway(btype int32, data []byte, timeout time.Duration) error

func (*Agent) String

func (m *Agent) String() string

func (*Agent) Twoway

func (m *Agent) Twoway(btype int32, data []byte, timeout time.Duration) (int32, []byte, error)

type AgentManager

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

func NewAgentManager

func NewAgentManager(
	addr string,

	readtimeout time.Duration,
	heart time.Duration,

	newagent func(*Agent),
	onenotify FunAgOnewaynotify,
	twonotify FunAgTwowaynotify,
	close FunAgClose,

) (*AgentManager, error)

func (*AgentManager) Agents

func (m *AgentManager) Agents() map[string]*Agent

func (*AgentManager) Listenport

func (m *AgentManager) Listenport() string

func (*AgentManager) Oneway

func (m *AgentManager) Oneway(aid string, btype int32, data []byte, timeout time.Duration) error

func (*AgentManager) Twoway

func (m *AgentManager) Twoway(aid string, btype int32, data []byte, timeout time.Duration) (int32, []byte, error)

type FunAgClose

type FunAgClose func(*Agent, []byte, error)

type FunAgOnewaynotify

type FunAgOnewaynotify func(*Agent, int32, []byte)

type FunAgTwowaynotify

type FunAgTwowaynotify func(*Agent, int32, []byte) (int32, []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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