mirror of
https://github.com/FAUSheppy/skillbird
synced 2025-12-10 00:08:33 +01:00
[git fast commit] 03. Feb 2019 - 00:10:34
This commit is contained in:
@@ -17,13 +17,14 @@ def listen():
|
||||
Thread(target=t_listen,args=(conn,)).start();
|
||||
|
||||
def t_listen(conn):
|
||||
try:
|
||||
data = conn.recv(BUFFER_SIZE).decode('utf-8')
|
||||
ret = NetworkParser.handleInput(data)
|
||||
if not ret:
|
||||
ret = "Rating Backend Error"
|
||||
if type(ret) == str:
|
||||
ret = ret.encode("utf-8")
|
||||
conn.send(ret)
|
||||
finally:
|
||||
conn.close()
|
||||
while True:
|
||||
try:
|
||||
data = conn.recv(BUFFER_SIZE).decode('utf-8')
|
||||
ret = NetworkParser.handleInput(data)
|
||||
if not ret:
|
||||
ret = "Rating Backend Error"
|
||||
if type(ret) == str:
|
||||
ret = ret.encode("utf-8")
|
||||
conn.send(ret)
|
||||
except Exception:
|
||||
conn.send(b"Rating Backend Exception (503 Database not in sync)")
|
||||
|
||||
Reference in New Issue
Block a user