Skip to content

Instantly share code, notes, and snippets.

@bcoe
Created Jul 22, 2010
Embed
What would you like to do?
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)
@bcoe
Copy link
Author

bcoe commented Jul 22, 2010

Orbited connects to port 9000 at which point the thread listening to RabbitMQ is spawned off.

@dr-alberto
Copy link

dr-alberto commented Jul 16, 2020

@bcoe How would be the way of implement this comet server in a Django app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment