Skip to content

Instantly share code, notes, and snippets.

@mizzy
Created April 9, 2013 08:25
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 mizzy/5343959 to your computer and use it in GitHub Desktop.
Save mizzy/5343959 to your computer and use it in GitHub Desktop.
import eventlet
def handle(fd):
while True:
c = fd.recv(16384)
if not c: break
fd.sendall(c)
server = eventlet.listen(('0.0.0.0', 8000))
pool = eventlet.GreenPool(size=32768)
count = 0
while True:
new_sock, address = server.accept()
pool.spawn_n(handle, new_sock)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment