MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / disconnect_websocket_server

Method disconnect_websocket_server

src/bonsai/bonsai/tool/web.py:181–193  ·  view source on GitHub ↗

Disconnects the WebSocket server and stops the associated thread. This method is responsible for disconnecting the WebSocket server, stopping the asyncio thread, and resetting the global variables related to the WebSocket connection.

(cls)

Source from the content-addressed store, hash-verified

179
180 @classmethod
181 def disconnect_websocket_server(cls) -> None:
182 """
183 Disconnects the WebSocket server and stops the associated thread.
184
185 This method is responsible for disconnecting the WebSocket server, stopping the asyncio thread,
186 and resetting the global variables related to the WebSocket connection.
187 """
188 global ws_thread, sio
189 ws_thread.run_coro(cls.sio_disconnect())
190 ws_thread.stop()
191 ws_thread = None
192 sio = None
193 cls.set_is_connected(False)
194
195 @classmethod
196 def kill_websocket_server(cls) -> None:

Callers 3

executeMethod · 0.80
kill_websocket_serverMethod · 0.80

Calls 4

run_coroMethod · 0.80
sio_disconnectMethod · 0.80
set_is_connectedMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected