Created
April 9, 2013 08:25
-
-
Save mizzy/5343959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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