gate

package
v0.0.0-...-6b053b6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgent

func NewAgent() *agent

Types

type Agent

type Agent interface {
	WriteMsg(msg interface{}, id ...string)
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
	RemoteIP() string
	Close(int)
	Destroy()
	UserData() interface{}
	SetUserData(data interface{})
	SetCloseFunc(f func(args ...interface{}))
	Skeleton() *module.Skeleton
	ChanRPC() *chanrpc.Server
}

type Gate

type Gate struct {
	MaxConnNum      int
	PendingWriteNum int
	MaxMsgLen       uint32
	Processor       network.Processor

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

	// tcp
	TCPAddr      string
	LenMsgLen    int
	LittleEndian bool

	// agent
	GoLen              int
	TimerDispatcherLen int
	AsynCallLen        int
	NewChanRPCFunc     func(Agent) UserHandler
	OnAgentInit        func(Agent)
	OnAgentDestroy     func(Agent)
}

func (*Gate) OnDestroy

func (gate *Gate) OnDestroy()

func (*Gate) Run

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

type IdUser

type IdUser interface {
	GetUid() int64
}

type UserHandler

type UserHandler interface {
	OnInit()
	OnDestroy()
	Run()
	GetChanRPC() *chanrpc.Server
}

Jump to

Keyboard shortcuts

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