We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`func (manager *Manager) putSession(session *Session) { smap := &manager.sessionMaps[session.id%sessionMapNum] smap.Lock() defer smap.Unlock()
smap.sessions[session.id] = session manager.disposeWait.Add(1)
}`
`const sessionMapNum = 32
type Manager struct { sessionMaps [sessionMapNum]sessionMap disposeFlag bool disposeOnce sync.Once disposeWait sync.WaitGroup }`
按照README说的 session的字面含义是会话,就是一次对话过程。每一个连接的生命周期被表达为一个会话过程,这个过程中通讯双方的消息有来有往。 意思是说同时只能有32个连接在线?
The text was updated successfully, but these errors were encountered:
32个sessionMap是为了降低存取session时的锁颗粒度,每个sessionMap里可以存放任意多的Session
Sorry, something went wrong.
No branches or pull requests
`func (manager *Manager) putSession(session *Session) {
smap := &manager.sessionMaps[session.id%sessionMapNum]
smap.Lock()
defer smap.Unlock()
}`
`const sessionMapNum = 32
type Manager struct {
sessionMaps [sessionMapNum]sessionMap
disposeFlag bool
disposeOnce sync.Once
disposeWait sync.WaitGroup
}`
按照README说的 session的字面含义是会话,就是一次对话过程。每一个连接的生命周期被表达为一个会话过程,这个过程中通讯双方的消息有来有往。
意思是说同时只能有32个连接在线?
The text was updated successfully, but these errors were encountered: