minor session changes.

This commit is contained in:
Miroslav Šedivý 2020-11-14 16:03:39 +01:00
parent e5eaf5c60c
commit 7c64e6068a
2 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ func (session *SessionCtx) Disconnect(reason string) error {
} }
// TODO: Refcator // TODO: Refcator
if err := session.socket.Send(&message.Disconnect{ if err := session.Send(&message.Disconnect{
Event: event.SYSTEM_DISCONNECT, Event: event.SYSTEM_DISCONNECT,
Message: reason, Message: reason,
}); err != nil { }); err != nil {

View File

@ -174,14 +174,14 @@ func (ws *WebSocketManagerCtx) Upgrade(w http.ResponseWriter, r *http.Request) e
Debug(). Debug().
Str("session", session.ID()). Str("session", session.ID()).
Str("address", connection.RemoteAddr().String()). Str("address", connection.RemoteAddr().String()).
Msg("new connection created") Msg("connection started")
defer func() { defer func() {
ws.logger. ws.logger.
Debug(). Debug().
Str("session", session.ID()). Str("session", session.ID()).
Str("address", connection.RemoteAddr().String()). Str("address", connection.RemoteAddr().String()).
Msg("session ended") Msg("connection ended")
}() }()
ws.handle(connection, session) ws.handle(connection, session)