查询聊天记录
This commit is contained in:
@@ -165,10 +165,11 @@ func handleMessages() {
|
||||
for {
|
||||
//读取通道中的消息
|
||||
msg := <-broadcast
|
||||
globals.SugarLogger.Debugf("clients len ", len(clients))
|
||||
globals.SugarLogger.Debugf("clients len %v", len(clients))
|
||||
//循环map客户端
|
||||
for client := range clients {
|
||||
//把通道中的消息发送给客户端
|
||||
globals.SugarLogger.Debugf("msg %v", utils.Format4Output(msg, false))
|
||||
err := client.WriteJSON(msg)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("client.WriteJSON error: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user