MCPcopy
hub / github.com/collabora/WhisperLive / close_websocket

Method close_websocket

whisper_live/client.py:350–366  ·  view source on GitHub ↗

Close the WebSocket connection and join the WebSocket thread. First attempts to close the WebSocket connection using `self.client_socket.close()`. After closing the connection, it joins the WebSocket thread to ensure proper termination.

(self)

Source from the content-addressed store, hash-verified

348 print(e)
349
350 def close_websocket(self):
351 """
352 Close the WebSocket connection and join the WebSocket thread.
353
354 First attempts to close the WebSocket connection using `self.client_socket.close()`. After
355 closing the connection, it joins the WebSocket thread to ensure proper termination.
356
357 """
358 try:
359 self.client_socket.close()
360 except Exception as e:
361 print("[ERROR]: Error closing WebSocket:", e)
362
363 try:
364 self.ws_thread.join()
365 except Exception as e:
366 print("[ERROR:] Error joining WebSocket thread:", e)
367
368 def get_client_socket(self):
369 """

Callers 11

tearDownMethod · 0.80
tearDownMethod · 0.80
tearDownMethod · 0.80
tearDownMethod · 0.80
tearDownMethod · 0.80
tearDownMethod · 0.80
close_all_clientsMethod · 0.80

Calls

no outgoing calls

Tested by 10

tearDownMethod · 0.64
tearDownMethod · 0.64
tearDownMethod · 0.64
tearDownMethod · 0.64
tearDownMethod · 0.64
tearDownMethod · 0.64