some other version

This commit is contained in:
Johannes Wendel
2019-12-05 21:46:14 +01:00
parent b49bfc65f0
commit 1591dd02ef
5 changed files with 11 additions and 9 deletions

View File

@@ -46,10 +46,11 @@ class Networking:
self.get("/displays" + display + "/write_score/" + str(score))
def getInputEvent(self):
header = ''
while chr(2) not in header:
header += str(self.input_socket.recv(1))
header = bytearray()
while b'\x02' not in header:
bla = self.input_socket.recv(1)
header.append(bla)
length = int(header[:-1])
length = int(str(header[:-1]))
return self.input_socket.recv(length)