mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add websocket destroy reason.
This commit is contained in:
@ -122,7 +122,7 @@ func (manager *SessionManagerCtx) Delete(id string) error {
|
||||
manager.sessionsMu.Unlock()
|
||||
|
||||
if session.State().IsConnected {
|
||||
session.GetWebSocketPeer().Destroy()
|
||||
session.GetWebSocketPeer().Destroy("session deleted")
|
||||
}
|
||||
|
||||
if session.State().IsWatching {
|
||||
|
@ -35,7 +35,7 @@ func (session *SessionCtx) profileChanged() {
|
||||
}
|
||||
|
||||
if (!session.profile.CanConnect || !session.profile.CanLogin) && session.state.IsConnected {
|
||||
session.websocketPeer.Destroy()
|
||||
session.websocketPeer.Destroy("profile changed")
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ func (session *SessionCtx) IsHost() bool {
|
||||
|
||||
func (session *SessionCtx) SetWebSocketPeer(websocketPeer types.WebSocketPeer) {
|
||||
if session.websocketPeer != nil {
|
||||
session.websocketPeer.Destroy()
|
||||
session.websocketPeer.Destroy("connection replaced")
|
||||
}
|
||||
|
||||
session.websocketPeer = websocketPeer
|
||||
|
Reference in New Issue
Block a user