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 thread, time | |
import socket | |
from hackwars.orbited_server.comet import handle_request | |
from orbited import start | |
def listen(): | |
try: | |
comet_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
comet_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
comet_socket.bind( ('', 9000) ) | |
comet_socket.listen(5) | |
while 1: | |
thread.start_new_thread(handle_request, comet_socket.accept()) | |
except Exception, e: | |
print str(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bcoe How would be the way of implement this comet server in a Django app?