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

Function connect_websocket_server

src/bonsai/bonsai/core/web.py:32–42  ·  view source on GitHub ↗
(web: type[tool.Web], port: int, page: str)

Source from the content-addressed store, hash-verified

30
31
32def connect_websocket_server(web: type[tool.Web], port: int, page: str) -> None:
33 # check if port already has a server listening to it
34 if web.is_port_available(port):
35 web.start_websocket_server(port)
36 if web.has_started(port):
37 web.connect_websocket_server(port)
38 web.send_theme_data()
39 web.open_web_browser(port, page)
40 return
41
42 web.connect_websocket_server(port)
43
44
45def disconnect_websocket_server(web: type[tool.Web]) -> None:

Callers

nothing calls this directly

Calls 6

is_port_availableMethod · 0.80
has_startedMethod · 0.80
send_theme_dataMethod · 0.80
open_web_browserMethod · 0.80

Tested by

no test coverage detected