This commit is contained in:
Liang Ding 2014-09-25 13:29:04 +08:00
parent 6f960c3760
commit 70caba9715
2 changed files with 4 additions and 1 deletions

View File

@ -220,6 +220,7 @@ func main() {
// HTTP Handler 包装.
// 完成共性处理:
//
// 1. panic recover
// 2. 请求计时
func handlerWrapper(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) {

View File

@ -1,5 +1,6 @@
// 会话操作.
// Wide 服务器端需要维护两种会话:
//
// 1. HTTP 会话:主要用于验证登录
// 2. Wide 会话:浏览器 tab 打开/刷新会创建一个,并和 HTTP 会话进行关联
//
@ -222,8 +223,9 @@ func (sessions *Sessions) Get(sid string) *WideSession {
// 移除 Wide 会话,释放相关资源.
// 会话相关资源:
//
// 1. 用户事件队列
// 2. 运行中的进程
// 2. 运行中的进程
// 3. WebSocket 通道
func (sessions *Sessions) Remove(sid string) {
mutex.Lock()