没啥用的处理

This commit is contained in:
Erope 2021-04-04 01:01:04 +08:00
parent ab9dfbc578
commit 44299459ff

View File

@ -195,7 +195,10 @@ func (cp *commonPage) ws(c *gin.Context) {
} }
count += 1 count += 1
if count%4 == 0 { if count%4 == 0 {
conn.WriteMessage(websocket.PingMessage, []byte{}) err = conn.WriteMessage(websocket.PingMessage, []byte{})
if err != nil {
break
}
} }
time.Sleep(time.Second * 2) time.Sleep(time.Second * 2)
} }