OH
This commit is contained in:
@@ -324,29 +324,26 @@ def run_server():
|
||||
conn.sendall(f"W{state.bw_fm}\n".encode())
|
||||
conn.sendall(f"M{tef.modulation}\n".encode())
|
||||
|
||||
while True:
|
||||
try:
|
||||
if conn.fileno() == -1: break
|
||||
while True:
|
||||
readable, _, _ = select.select([conn], [], [], 0.03)
|
||||
except (ValueError, OSError): break
|
||||
if readable:
|
||||
data = conn.recv(256)
|
||||
if not data: break
|
||||
try:
|
||||
resp = process_command(tef, data, state, conn)
|
||||
if resp: conn.sendall(resp)
|
||||
except Exception as e:
|
||||
if readable:
|
||||
data = conn.recv(256)
|
||||
if not data: break
|
||||
try:
|
||||
print(e)
|
||||
conn.sendall(b"!" + str(e).encode() + b"\n")
|
||||
except Exception: pass
|
||||
else:
|
||||
try: run_periodic(tef, conn, state)
|
||||
except Exception as e:
|
||||
try:
|
||||
print(e)
|
||||
conn.sendall(b"!" + str(e).encode() + b"\n")
|
||||
except Exception: pass
|
||||
resp = process_command(tef, data, state, conn)
|
||||
if resp: conn.sendall(resp)
|
||||
except Exception as e:
|
||||
try:
|
||||
print(e)
|
||||
conn.sendall(b"!" + str(e).encode() + b"\n")
|
||||
except Exception: pass
|
||||
else:
|
||||
try: run_periodic(tef, conn, state)
|
||||
except Exception as e:
|
||||
try:
|
||||
print(e)
|
||||
conn.sendall(b"!" + str(e).encode() + b"\n")
|
||||
except Exception: pass
|
||||
|
||||
import traceback
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user