Documentation ¶
Index ¶
- type IntranetSession
- func (sess *IntranetSession) DoClose(sessbase *nodecommon.SessionBase)
- func (sess *IntranetSession) DoLose(msg *protocol.MSG_MGR_LOSE_SERVER)
- func (sess *IntranetSession) DoRecv(cmd uint64, data []byte, flag byte) (done bool)
- func (sess *IntranetSession) DoRegister(msg *protocol.MSG_MGR_REGISTER_SERVER)
- func (sess *IntranetSession) DoVerify(msg *protocol.MSG_MGR_REGISTER_SERVER)
- func (sess *IntranetSession) Start()
- type IntranetSessionMgr
- func (mgr *IntranetSessionMgr) AddUser(account string, sess *nodecommon.SessionBase)
- func (mgr *IntranetSessionMgr) Close()
- func (mgr *IntranetSessionMgr) DelUser(account string)
- func (mgr *IntranetSessionMgr) GetAndActive(account string) *nodecommon.SessionBase
- func (mgr *IntranetSessionMgr) Start()
- type Normal
- type Session
- func (sess *Session) BroadcastMsgToClient(cmd uint64, data []byte, flag uint8) bool
- func (sess *Session) BroadcastMsgToServer(t config.NodeType, cmd uint64, data []byte, flag uint8) bool
- func (sess *Session) DoClose(sessbase *nodecommon.SessionBase)
- func (sess *Session) DoLose(msg *protocol.MSG_MGR_LOSE_SERVER)
- func (sess *Session) DoRecv(cmd uint64, data []byte, flag byte) (done bool)
- func (sess *Session) DoRegister(msg *protocol.MSG_MGR_REGISTER_SERVER)
- func (sess *Session) DoVerify(msg *protocol.MSG_MGR_REGISTER_SERVER)
- func (sess *Session) Ping()
- func (sess *Session) ReplyMsgToServer(targetID context.NodeID, cmd uint64, data []byte, flag uint8) bool
- func (sess *Session) SendMsgToClient(account string, cmd uint64, data []byte, flag uint8) bool
- func (sess *Session) SendMsgToServer(t config.NodeType, cmd uint64, data []byte, flag uint8) bool
- func (sess *Session) Shutdown()
- func (sess *Session) Start() bool
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntranetSession ¶
type IntranetSession struct { *nodecommon.SessionBase // contains filtered or unexported fields }
IntranetSession : 网络会话类( 服务器组内 Gateway 客户端会话类 )
func NewIntranetSession ¶
func NewIntranetSession(ctx *common.Context, sessMgr *nodecommon.SessionMgr, sourceSess *Session) *IntranetSession
NewIntranetSession : 网络会话类的构造函数
func (*IntranetSession) DoClose ¶
func (sess *IntranetSession) DoClose(sessbase *nodecommon.SessionBase)
DoClose : 节点关闭时处理
func (*IntranetSession) DoLose ¶
func (sess *IntranetSession) DoLose(msg *protocol.MSG_MGR_LOSE_SERVER)
DoLose : 节点丢失时处理
func (*IntranetSession) DoRecv ¶
func (sess *IntranetSession) DoRecv(cmd uint64, data []byte, flag byte) (done bool)
DoRecv : 节点收到消息处理
func (*IntranetSession) DoRegister ¶
func (sess *IntranetSession) DoRegister(msg *protocol.MSG_MGR_REGISTER_SERVER)
DoRegister : 某节点注册时处理
func (*IntranetSession) DoVerify ¶
func (sess *IntranetSession) DoVerify(msg *protocol.MSG_MGR_REGISTER_SERVER)
DoVerify : 验证时保存自己的注册消息
type IntranetSessionMgr ¶
type IntranetSessionMgr struct {
// contains filtered or unexported fields
}
IntranetSessionMgr : IntranetSession 对象管理类
func NewIntranetSessionMgr ¶
func NewIntranetSessionMgr(ctx *common.Context) *IntranetSessionMgr
NewIntranetSessionMgr :
func (*IntranetSessionMgr) AddUser ¶
func (mgr *IntranetSessionMgr) AddUser(account string, sess *nodecommon.SessionBase)
AddUser :
func (*IntranetSessionMgr) DelUser ¶
func (mgr *IntranetSessionMgr) DelUser(account string)
DelUser :
func (*IntranetSessionMgr) GetAndActive ¶
func (mgr *IntranetSessionMgr) GetAndActive(account string) *nodecommon.SessionBase
GetAndActive :
type Normal ¶
type Normal struct { *Session // contains filtered or unexported fields }
Normal : 普通节点
type Session ¶
type Session struct { *nodecommon.SessionBase GWMgr *IntranetSessionMgr // contains filtered or unexported fields }
Session : 网络会话类
func (*Session) BroadcastMsgToClient ¶
BroadcastMsgToClient : 广播消息给客户端,通过 Gateway 中继
func (*Session) BroadcastMsgToServer ¶
func (sess *Session) BroadcastMsgToServer(t config.NodeType, cmd uint64, data []byte, flag uint8) bool
BroadcastMsgToServer : 广播消息给某类型服务
func (*Session) DoClose ¶
func (sess *Session) DoClose(sessbase *nodecommon.SessionBase)
DoClose : 节点关闭时处理
func (*Session) DoLose ¶
func (sess *Session) DoLose(msg *protocol.MSG_MGR_LOSE_SERVER)
DoLose : 节点丢失时处理
func (*Session) DoRegister ¶
func (sess *Session) DoRegister(msg *protocol.MSG_MGR_REGISTER_SERVER)
DoRegister : 某节点注册时处理
func (*Session) DoVerify ¶
func (sess *Session) DoVerify(msg *protocol.MSG_MGR_REGISTER_SERVER)
DoVerify : 验证时保存自己的注册消息
func (*Session) ReplyMsgToServer ¶
func (sess *Session) ReplyMsgToServer(targetID context.NodeID, cmd uint64, data []byte, flag uint8) bool
ReplyMsgToServer : 回发消息给请求服务器
func (*Session) SendMsgToClient ¶
SendMsgToClient : 发送消息给客户端,通过 Gateway 中继
func (*Session) SendMsgToServer ¶
SendMsgToServer : 发送消息给某类型服务(随机一个)
type User ¶
type User struct { Account string Sess *nodecommon.SessionBase ActiveTimestamp int64 }
User :
Click to show internal directories.
Click to hide internal directories.