GodotPythonJSONRPC/addons/KiriPythonRPCWrapper/test_rpc.py

29 lines
528 B
Python
Raw Normal View History

#!/usr/bin/python3
import time
import KiriPacketSocket
ps = KiriPacketSocket.PacketSocket()
ps.start_server(("127.0.0.1", 9506))
connections = []
while True:
psc = ps.get_next_server_connection()
if psc:
print("Got connection.")
connections.append(psc)
psc.send_packet(b'ABCDEFGHIJ')
for conn in connections:
p = conn.get_next_packet()
while p:
print(p)
conn.send_packet(p + b'1')
p = conn.get_next_packet()
time.sleep(0.0001)