MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / stop

Method stop

tests/utils/device_simulator.py:70–90  ·  view source on GitHub ↗

Stop the simulator server.

(self)

Source from the content-addressed store, hash-verified

68 self._thread.start()
69
70 def stop(self) -> None:
71 """Stop the simulator server."""
72 self._running = False
73
74 if self._client_socket:
75 try:
76 self._client_socket.close()
77 except Exception:
78 pass
79 self._client_socket = None
80
81 if self._socket:
82 try:
83 self._socket.close()
84 except Exception:
85 pass
86 self._socket = None
87
88 if self._thread:
89 self._thread.join(timeout=2.0)
90 self._thread = None
91
92 def _server_loop(self) -> None:
93 """Server loop for accepting connections."""

Callers 3

device_simulatorFunction · 0.95
__exit__Method · 0.95
device_simulatorFunction · 0.95

Calls 1

closeMethod · 0.45

Tested by 1

device_simulatorFunction · 0.76