gate

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	WriteMsg(msg interface{})
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
	Close()
	Destroy()
	UserData() interface{}
	SetUserData(data interface{})
	GetNo() uint32
}

type ClientGate

type ClientGate struct {
	ConnNum         int
	PendingWriteNum int
	MaxMsgLen       uint32
	Processor       network.Processor
	AgentChanRPC    *chanrpc.Server

	NewAgentName   string
	CloseAgentName string

	// websocket
	WSAddr          string
	HTTPTimeout     time.Duration
	ReadTimeOut     time.Duration
	ConnectInterval time.Duration
	AutoReconnect   bool

	// tcp
	TCPAddr   string
	TcpParser network.TcpParser
	// contains filtered or unexported fields
}

func (*ClientGate) OnDestroy

func (c *ClientGate) OnDestroy()

func (*ClientGate) Run

func (c *ClientGate) Run()

func (*ClientGate) Stop

func (c *ClientGate) Stop()

type ServerGate

type ServerGate struct {
	MaxConnNum      int
	PendingWriteNum int
	MaxMsgLen       uint32
	Processor       network.Processor
	AgentChanRPC    *chanrpc.Server

	NewAgentName   string
	CloseAgentName string

	// websocket
	WSAddr      string
	HTTPTimeout time.Duration
	CertFile    string
	KeyFile     string

	// tcp
	TCPAddr   string
	TcpParser network.TcpParser
}

func (*ServerGate) OnDestroy

func (gate *ServerGate) OnDestroy()

func (*ServerGate) Run

func (gate *ServerGate) Run(closeSig chan bool)

Jump to

Keyboard shortcuts

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