MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / is_port_open

Function is_port_open

tests/e2e/utils/serving_utils.py:20–29  ·  view source on GitHub ↗

Check if a TCP port is open on the given host. Returns True if connection succeeds, False otherwise.

(host: str, port: int, timeout=1.0)

Source from the content-addressed store, hash-verified

18
19
20def is_port_open(host: str, port: int, timeout=1.0):
21 """
22 Check if a TCP port is open on the given host.
23 Returns True if connection succeeds, False otherwise.
24 """
25 try:
26 with socket.create_connection((host, port), timeout):
27 return True
28 except Exception:
29 return False
30
31
32def _clean_cuda_process():

Callers 15

setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_w4afp8_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90
setup_and_run_serverFunction · 0.90

Calls

no outgoing calls

Tested by 15

setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_w4afp8_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72
setup_and_run_serverFunction · 0.72