Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

pyflix: don't quit on any sendto error

Oleg Kalacheve44f32fca796
diff --git a/tools/pyflix/proxy.py b/tools/pyflix/proxy.py
index dbd1581..429867e 100755
--- a/tools/pyflix/proxy.py
+++ b/tools/pyflix/proxy.py
@@ -24,13 +24,16 @@ def main():
if addr in TARGETS: # packet from target
if source_addr is None:
continue
- sock.sendto(data, source_addr)
+ try:
+ sock.sendto(data, source_addr)
+ packets += 1
+ except: pass
else: # packet from source
source_addr = addr
for target in TARGETS:
sock.sendto(data, target)
+ packets += 1
- packets += 1
print(f'\rPackets: {packets}', end='')
if __name__ == '__main__':