Documentation ¶
Index ¶
- func NewTcpServer(cfg string) interfaces.IServer
- func RegistHead(head interfaces.IHead)
- type HeadBase
- func (h *HeadBase) Check() error
- func (h *HeadBase) GetBodyLen() uint32
- func (h *HeadBase) GetHeadLen() uint32
- func (h *HeadBase) GetOpcode() uint32
- func (h *HeadBase) Marshal() []byte
- func (h *HeadBase) PreHandle(buf []byte) ([]byte, error)
- func (h *HeadBase) PreSend(buf []byte) ([]byte, error)
- func (h *HeadBase) SetBodyLen(uint32)
- func (h *HeadBase) SetHeadLen(l uint32)
- func (h *HeadBase) SetOpcode(uint32)
- func (h *HeadBase) UnMarshal(buf []byte) error
- type Request
- type Response
- type Session
- type SessionMgr
- func (sm *SessionMgr) Add(s interfaces.ISession)
- func (sm *SessionMgr) GetSession(sid string) interfaces.ISession
- func (sm *SessionMgr) Len() uint32
- func (sm *SessionMgr) Remove(sid string)
- func (sm *SessionMgr) RemoveAll()
- func (sm *SessionMgr) Size() uint32
- func (sm *SessionMgr) Start()
- func (sm *SessionMgr) Stop()
- type TcpServer
- func (s *TcpServer) CallOnConnect(sid string)
- func (s *TcpServer) CallOnDisConnect(sid string)
- func (s *TcpServer) GetHandleMgr() interfaces.IHandleMgr
- func (s *TcpServer) GetSessionMgr() interfaces.ISessionMgr
- func (s *TcpServer) Push(sid string, opcode uint32, msg []byte)
- func (s *TcpServer) RegisterOnConnect(connect interfaces.NotifyCallback)
- func (s *TcpServer) RegisterOnDisConnect(disconnect interfaces.NotifyCallback)
- func (s *TcpServer) RegisterRouter(id uint32, router interfaces.RouterCallback)
- func (s *TcpServer) Serve()
- func (s *TcpServer) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTcpServer ¶
func NewTcpServer(cfg string) interfaces.IServer
func RegistHead ¶
func RegistHead(head interfaces.IHead)
Types ¶
type HeadBase ¶
type HeadBase struct { }
func (*HeadBase) GetBodyLen ¶
func (*HeadBase) GetHeadLen ¶
func (*HeadBase) SetBodyLen ¶
func (*HeadBase) SetHeadLen ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) GetSessionID ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) GetRemoteAddr ¶
func (*Session) GetSessionID ¶
type SessionMgr ¶
type SessionMgr struct {
// contains filtered or unexported fields
}
func NewSessionManage ¶
func NewSessionManage() *SessionMgr
func (*SessionMgr) Add ¶
func (sm *SessionMgr) Add(s interfaces.ISession)
func (*SessionMgr) GetSession ¶
func (sm *SessionMgr) GetSession(sid string) interfaces.ISession
func (*SessionMgr) Len ¶
func (sm *SessionMgr) Len() uint32
func (*SessionMgr) Remove ¶
func (sm *SessionMgr) Remove(sid string)
func (*SessionMgr) RemoveAll ¶
func (sm *SessionMgr) RemoveAll()
func (*SessionMgr) Size ¶
func (sm *SessionMgr) Size() uint32
func (*SessionMgr) Start ¶
func (sm *SessionMgr) Start()
func (*SessionMgr) Stop ¶
func (sm *SessionMgr) Stop()
type TcpServer ¶
type TcpServer struct { Addr string SessionMgr interfaces.ISessionMgr HandlerMgr interfaces.IHandleMgr OnConnect interfaces.NotifyCallback OnDisConnect interfaces.NotifyCallback // contains filtered or unexported fields }
func (*TcpServer) CallOnConnect ¶
func (*TcpServer) CallOnDisConnect ¶
func (*TcpServer) GetHandleMgr ¶
func (s *TcpServer) GetHandleMgr() interfaces.IHandleMgr
func (*TcpServer) GetSessionMgr ¶
func (s *TcpServer) GetSessionMgr() interfaces.ISessionMgr
func (*TcpServer) RegisterOnConnect ¶
func (s *TcpServer) RegisterOnConnect(connect interfaces.NotifyCallback)
func (*TcpServer) RegisterOnDisConnect ¶
func (s *TcpServer) RegisterOnDisConnect(disconnect interfaces.NotifyCallback)
func (*TcpServer) RegisterRouter ¶
func (s *TcpServer) RegisterRouter(id uint32, router interfaces.RouterCallback)
Click to show internal directories.
Click to hide internal directories.