Documentation ¶
Overview ¶
Copyright 2020 newtbig Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func NewSession(app module.App) module.Session
- type Session
- func (s *Session) Call(msg *framepb.Msg) error
- func (s *Session) CallKick() error
- func (s *Session) GetProcessor() module.Processor
- func (s *Session) GetUID() uint64
- func (s *Session) Kick() error
- func (s *Session) OnClose() error
- func (s *Session) OnInit(app module.App) error
- func (s *Session) OnStart(_conn module.Connect) error
- func (s *Session) OnStop() error
- func (s *Session) Save() error
- func (s *Session) SendByte(data []byte) error
- func (s *Session) SendMsg(msg *framepb.Msg) error
- func (s *Session) SetHeartBeatTime(time time.Time)
- func (s *Session) SetUID(id uint64)
- type SessionMgr
- func (sm *SessionMgr) AddSession(session *Session) bool
- func (sm *SessionMgr) BroatCast(msg *framepb.Msg) error
- func (sm *SessionMgr) Count() int32
- func (sm *SessionMgr) DelSession(uid uint64)
- func (sm *SessionMgr) GetSession(uid uint64) *Session
- func (sm *SessionMgr) Receive(msg *framepb.Msg) error
- func (sm *SessionMgr) StopAllSession()
- func (sm *SessionMgr) StopSession(uid uint64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ClOSE_ERR = errors.New("seesion close")
Functions ¶
Types ¶
type Session ¶
type Session struct { IP net.IP Port string LastHeartBeatTime time.Time PacketCount uint32 PacketCount1Min int Processor module.Processor // contains filtered or unexported fields }
func (*Session) GetProcessor ¶
func (*Session) SetHeartBeatTime ¶
type SessionMgr ¶
func GetSessionMgr ¶
func GetSessionMgr() *SessionMgr
func (*SessionMgr) AddSession ¶
func (sm *SessionMgr) AddSession(session *Session) bool
func (*SessionMgr) Count ¶
func (sm *SessionMgr) Count() int32
func (*SessionMgr) DelSession ¶
func (sm *SessionMgr) DelSession(uid uint64)
func (*SessionMgr) GetSession ¶
func (sm *SessionMgr) GetSession(uid uint64) *Session
func (*SessionMgr) StopAllSession ¶ added in v0.0.9
func (sm *SessionMgr) StopAllSession()
func (*SessionMgr) StopSession ¶ added in v0.0.9
func (sm *SessionMgr) StopSession(uid uint64)
Click to show internal directories.
Click to hide internal directories.