close
Closes the current WebSocket session and marks the session as closed.
This method sets the internal state of the session to closed and performs the necessary cleanup by closing the active WebSocket session, if any. Once called, no further communication through this session is possible.
Throws no exceptions and ensures safe cleanup of resources.