This commit is contained in:
白茶清欢 2021-11-17 18:36:57 +08:00
parent 324f18f66e
commit f43fab8123

View File

@ -52,7 +52,7 @@ var (
// 日志实例表
loggerInstanceTable map[string]*zap.Logger
// 服务启停的信号
sigChan = make(chan int, 0)
sigChan = make(chan int, 1)
)
// NewWebsocketServe 启动websocket服务
@ -142,13 +142,6 @@ func initServer(wsInstance abstract.IWebsocket) {
s.wsServer.Config.PingPeriod = s.conf.PingPeriod
wsServerTable[wsInstance.GetServerPort()][wsInstance.GetModuleFlag()] = s
/*melody.Config{
WriteWait: 0,
PongWait: 0,
PingPeriod: 0,
MaxMessageSize: 0,
MessageBufferSize: 0,
}*/
}
// 初始化指令存储表
@ -332,7 +325,7 @@ func run() {
for port, ginInstance := range ginRouterTable {
go func(ginInstance *gin.Engine, port int) {
if err := ginInstance.Run(fmt.Sprintf(":%d", port)); nil != err {
panic(fmt.Sprintf("%d 启动端口监听失败, 失败原因 : %s", err.Error()))
panic(fmt.Sprintf("%d 启动端口监听失败, 失败原因 : %s", port, err.Error()))
}
}(ginInstance, port)
}