MCPcopy Create free account
hub / github.com/1jehuang/jcode / connect_to_socket

Function connect_to_socket

scripts/jcode_monitor.py:62–70  ·  view source on GitHub ↗

Connect to the Unix socket

(path: str)

Source from the content-addressed store, hash-verified

60
61
62def connect_to_socket(path: str) -> Optional[socket.socket]:
63 """Connect to the Unix socket"""
64 try:
65 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
66 sock.connect(path)
67 sock.setblocking(False)
68 return sock
69 except Exception as e:
70 return None
71
72
73def send_request(sock: socket.socket, request: dict) -> bool:

Callers 1

mainFunction · 0.85

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected