mirror of
https://github.com/okalachev/flix.git
synced 2026-01-10 13:06:56 +00:00
pyflix: don't quit on any sendto error
This commit is contained in:
@@ -24,13 +24,16 @@ def main():
|
|||||||
if addr in TARGETS: # packet from target
|
if addr in TARGETS: # packet from target
|
||||||
if source_addr is None:
|
if source_addr is None:
|
||||||
continue
|
continue
|
||||||
sock.sendto(data, source_addr)
|
try:
|
||||||
|
sock.sendto(data, source_addr)
|
||||||
|
packets += 1
|
||||||
|
except: pass
|
||||||
else: # packet from source
|
else: # packet from source
|
||||||
source_addr = addr
|
source_addr = addr
|
||||||
for target in TARGETS:
|
for target in TARGETS:
|
||||||
sock.sendto(data, target)
|
sock.sendto(data, target)
|
||||||
|
packets += 1
|
||||||
|
|
||||||
packets += 1
|
|
||||||
print(f'\rPackets: {packets}', end='')
|
print(f'\rPackets: {packets}', end='')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user