mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
16 lines
459 B
Python
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()
|