Documentation
¶
Index ¶
- Constants
- Variables
- type Agent
- func (a *Agent) GetConnInfo() *acceptor.ConnInfo
- func (a *Agent) GetId() int64
- func (a *Agent) GetLastTimeOnline() int64
- func (a *Agent) GetLatency() int64
- func (a *Agent) GetSession() *session.Session
- func (a *Agent) GetStatus() int32
- func (a *Agent) IsClosed() bool
- func (a *Agent) LocalAddr() net.Addr
- func (a *Agent) RemoteAddr() net.Addr
- func (a *Agent) Send(in interface{}, name ...string) error
- func (a *Agent) SendData(data []byte)
- func (a *Agent) SetLastAt()
- func (a *Agent) SetStatus(state int32)
- func (a *Agent) Start()
- func (a *Agent) Stop() error
- type AgentFacotry
Constants ¶
View Source
const ( // StatusStart status StatusStart int32 // StatusHandshake status StatusHandshake // StatusWorking status StatusWorking // StatusClosed status StatusClosed )
Variables ¶
View Source
var (
ErrCloseClosedSession = errors.New("close closed session")
)
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { AgentID int64 // user id // contains filtered or unexported fields }
Agent corresponds to a user and is used for storing raw Conn information
func (*Agent) GetConnInfo ¶
func (*Agent) GetLastTimeOnline ¶
func (*Agent) GetLatency ¶
func (*Agent) GetSession ¶
func (*Agent) RemoteAddr ¶
type AgentFacotry ¶
type AgentFacotry struct {
// contains filtered or unexported fields
}
AgentFacotry is the facotry to create the agent
func NewAgentFactory ¶
func NewAgentFactory(config *config.Config, pool session.SessionPool, messageServer *message.MessageServer) *AgentFacotry
func (*AgentFacotry) NewAgent ¶
func (af *AgentFacotry) NewAgent(conn acceptor.AcceptorConn) *Agent
Click to show internal directories.
Click to hide internal directories.