new websocket session list
()
| 38 | |
| 39 | // new websocket session list |
| 40 | func NewSessionList() *SessionList { |
| 41 | return &SessionList{ |
| 42 | mapOnlineList: make(map[string]*Session), |
| 43 | } |
| 44 | } |
| 45 | func (self *SessionList) NewSession(wsConn *websocket.Conn) (session *Session, err error) { |
| 46 | if self.GetSessionCount() > MAX_SESSION_COUNT { |
| 47 | return nil, errors.New("over MAX_SESSION_COUNT") |