fix
This commit is contained in:
parent
fcd20e7fc2
commit
9a8bdcb5ba
@ -193,15 +193,18 @@ func (w *wsConnectItem) readLoop() {
|
||||
case <-w.closeChan: //如果关闭了
|
||||
return
|
||||
default:
|
||||
_, data, err := w.conn.ReadMessage()
|
||||
msgType, data, err := w.conn.ReadMessage()
|
||||
if err != nil {
|
||||
logx.Error("接受信息错误:", err)
|
||||
//关闭连接
|
||||
w.close()
|
||||
return
|
||||
}
|
||||
//消息传入缓冲通道
|
||||
w.inChan <- data
|
||||
//ping的消息不处理
|
||||
if msgType != websocket.PingMessage {
|
||||
//消息传入缓冲通道
|
||||
w.inChan <- data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user