MCPcopy Create free account
hub / github.com/DNAProject/DNA / NewSession

Method NewSession

http/websocket/session/sessionlist.go:45–56  ·  view source on GitHub ↗
(wsConn *websocket.Conn)

Source from the content-addressed store, hash-verified

43 }
44}
45func (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")
48 }
49 session = newSession(wsConn)
50
51 self.Lock()
52 self.mapOnlineList[session.GetSessionId()] = session
53 self.Unlock()
54
55 return session, nil
56}
57func (self *SessionList) CloseSession(session *Session) {
58 if session == nil {
59 return

Callers 1

webSocketHandlerMethod · 0.80

Calls 3

GetSessionCountMethod · 0.95
newSessionFunction · 0.85
GetSessionIdMethod · 0.80

Tested by

no test coverage detected