Files
psxrecomp/tools/_list_cmds.py
T
2026-05-07 17:57:34 -07:00

16 lines
459 B
Python

"""List debug-server commands and ring state."""
import socket, json
s = socket.create_connection(('127.0.0.1', 4370), timeout=10)
def send(p):
s.sendall((json.dumps(p) + '\n').encode())
buf = b''
while True:
c = s.recv(1<<20)
if not c: break
buf += c
if buf.strip().endswith(b'}'):
try: return json.loads(buf.decode())
except: continue
print('help:', send({'id':1,'cmd':'help'}))
s.close()