(wsConnId string, stableId string, wproxy *wshutil.WshRpcProxy)
| 220 | } |
| 221 | |
| 222 | func registerConn(wsConnId string, stableId string, wproxy *wshutil.WshRpcProxy) { |
| 223 | GlobalLock.Lock() |
| 224 | defer GlobalLock.Unlock() |
| 225 | curConnInfo := RouteToConnMap[stableId] |
| 226 | if curConnInfo != nil { |
| 227 | log.Printf("[websocket] warning: replacing existing connection for stableid %q\n", stableId) |
| 228 | if curConnInfo.LinkId != baseds.NoLinkId { |
| 229 | wshutil.DefaultRouter.UnregisterLink(curConnInfo.LinkId) |
| 230 | } |
| 231 | } |
| 232 | linkId := wshutil.DefaultRouter.RegisterTrustedRouter(wproxy) |
| 233 | RouteToConnMap[stableId] = &StableConnInfo{ |
| 234 | ConnId: wsConnId, |
| 235 | LinkId: linkId, |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | func unregisterConn(wsConnId string, stableId string) { |
| 240 | GlobalLock.Lock() |
no test coverage detected