Documentation
¶
Index ¶
- Constants
- type Session
- func (s *Session) GetActiveTime() int64
- func (s *Session) GetOwner() int64
- func (s *Session) IsClosed() bool
- func (s *Session) LocalAddr() string
- func (s *Session) RemoteAddr() string
- func (s *Session) Run()
- func (s *Session) SessionId() string
- func (s *Session) SetActiveTime(activeTime int64)
- func (s *Session) SetCallBack(onDataCallback func(*Session, proto.EnvelopeType, []byte), ...) error
- func (s *Session) SetOwner(ownerId int64)
- func (s *Session) Stop()
- func (s *Session) Write(msgType proto.EnvelopeType, body []byte) error
- type SessionManager
- func (mgr *SessionManager) AddSession(s *Session)
- func (mgr *SessionManager) Count() uint32
- func (mgr *SessionManager) RangeSessions(f func(s *Session) bool)
- func (mgr *SessionManager) RemoveSession(s *Session)
- func (mgr *SessionManager) SessionById(id string) (s *Session)
- func (mgr *SessionManager) Stop()
Constants ¶
View Source
const (
SESSION_TIMEOUT_SEC = 60
)
View Source
const (
WRITE_CHAN_SIZE = 2048
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(con connInterface.IConnectInterface) *Session
func (*Session) GetActiveTime ¶
func (*Session) RemoteAddr ¶
func (*Session) SetActiveTime ¶
func (*Session) SetCallBack ¶
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionMgr ¶
func NewSessionMgr(maxConnNum uint32, timeoutSec int64) *SessionManager
func (*SessionManager) AddSession ¶
func (mgr *SessionManager) AddSession(s *Session)
func (*SessionManager) Count ¶
func (mgr *SessionManager) Count() uint32
func (*SessionManager) RangeSessions ¶
func (mgr *SessionManager) RangeSessions(f func(s *Session) bool)
func (*SessionManager) RemoveSession ¶
func (mgr *SessionManager) RemoveSession(s *Session)
func (*SessionManager) SessionById ¶
func (mgr *SessionManager) SessionById(id string) (s *Session)
func (*SessionManager) Stop ¶
func (mgr *SessionManager) Stop()
Click to show internal directories.
Click to hide internal directories.