Documentation ¶
Index ¶
- Constants
- func NewAgent(conn network.Conn, connector *Connector) *agent
- func NewAgentHandler(a *agent) *agentHandler
- type Connector
- func (c *Connector) GetSessionMap() *connector.SessionMap
- func (c *Connector) OnDestroy()
- func (c *Connector) OnInit(server component.ServerImpl)
- func (c *Connector) OnRun(closeSig chan bool)
- func (c *Connector) Route(f rpc.CustomerRoute)
- func (c *Connector) SetConnectionListener(conn connector.Connection)
- func (c *Connector) SetHandlerFilter(f filter.Filter)
- type Option
- func CertFile(f string) Option
- func HTTPTimeout(t time.Duration) Option
- func HeartbeatTimeout(t time.Duration) Option
- func KeyFile(f string) Option
- func LenMsgLen(num int) Option
- func LittleEndian(littleEndian bool) Option
- func MaxConnNum(num int) Option
- func MaxMsgLen(length uint32) Option
- func TCPAddr(addr string) Option
- func WSAddr(addr string) Option
- type Options
Constants ¶
View Source
const ( CODE_OK = 200 CODE_USE_ERROR = 500 CODE_OLD_CLIENT = 501 )
Variables ¶
This section is empty.
Functions ¶
func NewAgentHandler ¶
func NewAgentHandler(a *agent) *agentHandler
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func (*Connector) GetSessionMap ¶
func (c *Connector) GetSessionMap() *connector.SessionMap
func (*Connector) OnInit ¶
func (c *Connector) OnInit(server component.ServerImpl)
func (*Connector) Route ¶
func (c *Connector) Route(f rpc.CustomerRoute)
func (*Connector) SetConnectionListener ¶
func (c *Connector) SetConnectionListener(conn connector.Connection)
func (*Connector) SetHandlerFilter ¶
Set a filter for client handler
type Option ¶
type Option func(*Options)
func HTTPTimeout ¶
Timeout for http handshake. Default is 10s
func HeartbeatTimeout ¶
Heartbeat timeout. Default is 10s. Disconnect if after 2*t
Click to show internal directories.
Click to hide internal directories.