Skip to content

Instantly share code, notes, and snippets.

@ahmedfgad
Created June 23, 2020 19:42
Show Gist options
  • Select an option

  • Save ahmedfgad/5ca7b3612cd96412a409f49dcc232291 to your computer and use it in GitHub Desktop.

Select an option

Save ahmedfgad/5ca7b3612cd96412a409f49dcc232291 to your computer and use it in GitHub Desktop.
while True:
try:
connection, client_info = soc.accept()
print("New Connection from {client_info}.".format(client_info=client_info))
socket_thread = SocketThread(connection=connection,
client_info=client_info,
buffer_size=1024,
recv_timeout=10)
socket_thread.start()
except:
soc.close()
print("(Timeout) Socket Closed Because no Connections Received.\n")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment