无响应时关闭连接

pull/23/head 0.3.7
taoshihan1991 4 years ago
parent 5d72900874
commit 826bd2ac63

@ -74,6 +74,7 @@ func AddVisitorToList(user *User) {
str, _ := json.Marshal(msg) str, _ := json.Marshal(msg)
if err := oldUser.Conn.WriteMessage(websocket.TextMessage, str); err != nil { if err := oldUser.Conn.WriteMessage(websocket.TextMessage, str); err != nil {
oldUser.Conn.Close() oldUser.Conn.Close()
user.UpdateTime = oldUser.UpdateTime
delete(ClientList, user.Id) delete(ClientList, user.Id)
} }
} }

Loading…
Cancel
Save