MCPcopy Create free account
hub / github.com/InternScience/SciReason / check_socket

Function check_socket

opencompass/utils/network.py:66–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64
65 # Method 1: Socket connection test (direct connection, no proxy)
66 def check_socket() -> bool:
67 try:
68 socket.create_connection((host, port), timeout=timeout)
69 return True
70 except OSError:
71 return False
72
73 # Method 2: HTTP request test (supports proxy)
74 def check_http() -> bool:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected