This commit is contained in:
2026-03-24 22:13:20 +01:00
parent d4a32c660c
commit 4617819085
+18 -21
View File
@@ -324,29 +324,26 @@ def run_server():
conn.sendall(f"W{state.bw_fm}\n".encode()) conn.sendall(f"W{state.bw_fm}\n".encode())
conn.sendall(f"M{tef.modulation}\n".encode()) conn.sendall(f"M{tef.modulation}\n".encode())
while True: while True:
try:
if conn.fileno() == -1: break
readable, _, _ = select.select([conn], [], [], 0.03) readable, _, _ = select.select([conn], [], [], 0.03)
except (ValueError, OSError): break if readable:
if readable: data = conn.recv(256)
data = conn.recv(256) if not data: break
if not data: break
try:
resp = process_command(tef, data, state, conn)
if resp: conn.sendall(resp)
except Exception as e:
try: try:
print(e) resp = process_command(tef, data, state, conn)
conn.sendall(b"!" + str(e).encode() + b"\n") if resp: conn.sendall(resp)
except Exception: pass except Exception as e:
else: try:
try: run_periodic(tef, conn, state) print(e)
except Exception as e: conn.sendall(b"!" + str(e).encode() + b"\n")
try: except Exception: pass
print(e) else:
conn.sendall(b"!" + str(e).encode() + b"\n") try: run_periodic(tef, conn, state)
except Exception: pass except Exception as e:
try:
print(e)
conn.sendall(b"!" + str(e).encode() + b"\n")
except Exception: pass
import traceback import traceback
if __name__ == "__main__": if __name__ == "__main__":