Add shebang and handle client

disconnection errors
This commit is contained in:
Jakob Kordež 2023-12-09 21:41:57 +01:00
parent 455a409e0b
commit 544d5dd265
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,5 @@
#!/usr/bin/python3
######################################################
# FlexRadio discovery Proxy CLIENT
######################################################

View File

@ -1,3 +1,5 @@
#!/usr/bin/python3
######################################################
# FlexRadio discovery Proxy
######################################################
@ -59,9 +61,12 @@ try:
data = None
if not data:
# A client socket has been disconnected
print("Client disconnected:", s.getpeername())
try:
print("Client disconnected:", s.getpeername())
s.close()
except:
print("Client disconnected")
clients.remove(s)
s.close()
except KeyboardInterrupt:
print("\nExiting...")
for s in clients: