(self)
| 200 | self.session.send_client_event(event) |
| 201 | |
| 202 | def notify_connection_lost(self): |
| 203 | logger.debug("WebSocket closed") |
| 204 | if not self.reconnectable and self.session: |
| 205 | # when the connection lost is caused by `on_session_close()`, it's OK to close the session here though. |
| 206 | # because the `session.close()` is reentrant |
| 207 | self.session.close(nonblock=True) |
| 208 | self.session = None # reset the reference |
| 209 | return |
| 210 | |
| 211 | _reconnect_state.active_connections.pop(self.session_id, None) |
| 212 | if self.session_id in _reconnect_state.unclosed_sessions: |
| 213 | _reconnect_state.detached_sessions[self.session_id] = time.time() |
no test coverage detected