session state decoupled.

This commit is contained in:
Miroslav Šedivý 2021-03-14 00:50:08 +01:00
parent 4a28307c1e
commit ecad2124fd
4 changed files with 8 additions and 19 deletions

View file

@ -180,7 +180,7 @@ func (manager *WebSocketManagerCtx) Upgrade(w http.ResponseWriter, r *http.Reque
return connection.Close()
}
if session.IsConnected() {
if session.State().IsConnected {
// TODO: Refactor, return error code.
if err = connection.WriteJSON(
message.SystemDisconnect{