Close the WebSocket connection.
()
| 79 | |
| 80 | |
| 81 | def disconnect_websocket(): |
| 82 | """Close the WebSocket connection.""" |
| 83 | if "ws" in st.session_state and st.session_state.ws: |
| 84 | try: |
| 85 | st.session_state.ws.close() |
| 86 | except Exception as e: |
| 87 | # Log or handle potential errors on close if necessary |
| 88 | print(f"Error closing websocket: {e}") |
| 89 | del st.session_state.ws |
| 90 | |
| 91 | |
| 92 | def send_websocket_message(message): |
no outgoing calls
no test coverage detected