MCPcopy Index your code
hub / github.com/masterking32/MasterHttpRelayVPN / stop

Method stop

src/proxy/proxy_server.py:401–426  ·  view source on GitHub ↗

Shut down all listeners and release relay resources.

(self)

Source from the content-addressed store, hash-verified

399 raise
400
401 async def stop(self):
402 """Shut down all listeners and release relay resources."""
403 for srv in self._servers:
404 try:
405 srv.close()
406 except Exception:
407 pass
408 for srv in self._servers:
409 try:
410 await srv.wait_closed()
411 except Exception:
412 pass
413 self._servers = []
414
415 current = asyncio.current_task()
416 client_tasks = [task for task in self._client_tasks if task is not current]
417 for task in client_tasks:
418 task.cancel()
419 if client_tasks:
420 await asyncio.gather(*client_tasks, return_exceptions=True)
421 self._client_tasks.clear()
422
423 try:
424 await self.fronter.close()
425 except Exception as exc:
426 log.debug("fronter.close: %s", exc)
427
428 # ── client handler ────────────────────────────────────────────
429

Callers 1

_runFunction · 0.95

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected