mirror of
https://github.com/besterprotocol/besterd
synced 2023-12-13 21:00:32 +01:00
17 lines
375 B
Python
17 lines
375 B
Python
import socket
|
|
import json
|
|
|
|
def runTest():
|
|
d=socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
d.bind("../aSock")
|
|
d.listen()
|
|
while True:
|
|
s = d.accept()[0]
|
|
print(list(s.recv(130)))
|
|
bys = json.dumps({"response" : "ppoop"})
|
|
print(s.send(bytes([len(bys),0,0,0])))
|
|
print(s.send(bys.encode()))
|
|
|
|
while True: pass
|
|
|
|
runTest() |