增加连接的connection_id

This commit is contained in:
2021-04-08 17:26:12 +08:00
parent fef46f3a0b
commit cf11a23a9d
5 changed files with 71 additions and 5 deletions

View File

@ -60,7 +60,7 @@ func NewWebsocketServe(wsInstanceList ...abstract.IWebsocket) error {
go func(wsInstance abstract.IWebsocket) {
defer wg.Done()
// 初始化ws server
_ = lock.Lock("")
_ = lock.Lock()
if _, exist := ginRouterTable[wsInstance.GetServerPort()]; !exist {
ginRouterTable[wsInstance.GetServerPort()] = &Server{
ginRouter: gin.Default(),
@ -70,7 +70,7 @@ func NewWebsocketServe(wsInstanceList ...abstract.IWebsocket) error {
if _, exist := commandTable[wsInstance.GetModuleFlag()]; !exist {
commandTable[wsInstance.GetModuleFlag()] = make(map[string]abstract.ICommand)
}
_ = lock.Unlock("")
_ = lock.Unlock()
routerGroup := ginRouterTable[wsInstance.GetServerPort()].ginRouter.Group(wsInstance.GetModuleFlag())
// 注册路由
for _, path := range wsInstance.HandshakeURL() {