Skip to content

Instantly share code, notes, and snippets.

@Lukasa
Created August 15, 2016 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lukasa/f8c9dcc553cd68a33c31ac434a0b8e42 to your computer and use it in GitHub Desktop.
Save Lukasa/f8c9dcc553cd68a33c31ac434a0b8e42 to your computer and use it in GitHub Desktop.
Is this an event loop?
from __future__ import print_function
def socket_loop(sock):
while True:
data = sock.recv(8192)
print(data)
if not data:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment