sfps callback

This commit is contained in:
richboo111
2023-06-01 17:22:38 +08:00
parent 69183b4802
commit 2e0dc42f72
4 changed files with 46 additions and 27 deletions

View File

@@ -79,10 +79,7 @@ func PingTimer() {
go func() {
ticker := time.NewTicker(heartbeatInterval)
defer ticker.Stop()
//测试用
//i := 0
for {
//i++
<-ticker.C
for clientId, conn := range Manager.AllClient() {
if conn.ClientType == ClientTypeJx {
@@ -93,12 +90,14 @@ func PingTimer() {
if err := ConnRender(conn.Socket, renderData{ClientId: clientId}); err != nil {
return
}
globals.SugarLogger.Debugf("PingTimer jx clientID ")
} else {
if err := conn.Socket.WriteMessage(websocket.TextMessage, []byte(HeartCheckMsg)); err != nil {
fmt.Printf("PingTimer mtHeartBeat err:%v", err)
//对美团重新建立连接
MtInit()
}
}
}
}
@@ -159,7 +158,7 @@ func (c *Client) Read() {
}
}
fmt.Printf("Client Read:receive: %s\n", string(msg))
SendToVendor(msg)
//SendToVendor(msg)
}
}()
}