Documentation ¶
Overview ¶
Package session privides websocket server manager sessionlist
Index ¶
- Constants
- type Session
- func (self *Session) AppendTxHash(txhash string)
- func (self *Session) Close()
- func (self *Session) GetSessionId() string
- func (self *Session) RemoveTimeoverTxHashes() (remove []TxHashInfo)
- func (self *Session) Send(data []byte) error
- func (self *Session) SessionTimeoverCheck() bool
- func (self *Session) UpdateActiveTime()
- type SessionList
- func (self *SessionList) CloseSession(session *Session)
- func (self *SessionList) ForEachSession(visit func(*Session))
- func (self *SessionList) GetSessionById(sessionId string) *Session
- func (self *SessionList) GetSessionCount() int
- func (self *SessionList) NewSession(wsConn *websocket.Conn) (session *Session, err error)
- type TxHashInfo
Constants ¶
View Source
const MAX_SESSION_COUNT = 3000
View Source
const SESSION_TIMEOUT int64 = 300
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { sync.Mutex TxHashArr []TxHashInfo //transaction hashes in this session // contains filtered or unexported fields }
websocket session
func (*Session) AppendTxHash ¶
append transaction hash
func (*Session) GetSessionId ¶
func (*Session) RemoveTimeoverTxHashes ¶
func (self *Session) RemoveTimeoverTxHashes() (remove []TxHashInfo)
remove timew over transaction hashes
func (*Session) SessionTimeoverCheck ¶
sesseion time over check
type SessionList ¶
func (*SessionList) CloseSession ¶
func (self *SessionList) CloseSession(session *Session)
func (*SessionList) ForEachSession ¶
func (self *SessionList) ForEachSession(visit func(*Session))
func (*SessionList) GetSessionById ¶
func (self *SessionList) GetSessionById(sessionId string) *Session
func (*SessionList) GetSessionCount ¶
func (self *SessionList) GetSessionCount() int
func (*SessionList) NewSession ¶
func (self *SessionList) NewSession(wsConn *websocket.Conn) (session *Session, err error)
type TxHashInfo ¶
Click to show internal directories.
Click to hide internal directories.