Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSugerLogger ¶
func GetSugerLogger() *zap.SugaredLogger
func InitLogger ¶
Types ¶
type Server ¶
type Server struct { Ip string Port int ClientPool SessionPool IdleDuration time.Duration OnMessage func(*Session, []byte) OnError func(*Session, error) OnSpliter func([]byte, bool) (int, []byte, error) Stop bool }
func (*Server) CloseServer ¶
func (s *Server) CloseServer()
func (*Server) HandleConnection ¶
type SessionPool ¶
type SessionPool struct { Source sync.Map Add chan *Session Delete chan *Session SessionCount int Close bool }
func (*SessionPool) AddSession ¶
func (s *SessionPool) AddSession(c *Session)
func (*SessionPool) CheckConnection ¶
func (s *SessionPool) CheckConnection()
func (*SessionPool) DeleteSession ¶
func (s *SessionPool) DeleteSession(c *Session)
func (*SessionPool) GetSessionCount ¶
func (s *SessionPool) GetSessionCount() int
func (*SessionPool) Manager ¶
func (s *SessionPool) Manager()
Click to show internal directories.
Click to hide internal directories.