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

Function send_request

scripts/jcode_monitor.py:73–80  ·  view source on GitHub ↗

Send a JSON request to the socket

(sock: socket.socket, request: dict)

Source from the content-addressed store, hash-verified

71
72
73def send_request(sock: socket.socket, request: dict) -> bool:
74 """Send a JSON request to the socket"""
75 try:
76 data = json.dumps(request) + "\n"
77 sock.send(data.encode())
78 return True
79 except:
80 return False
81
82
83def read_events(sock: socket.socket) -> list:

Callers 1

mainFunction · 0.70

Calls 2

encodeMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected