#!/usr/bin/python from server import server from util import fedd_ssl_context from select import select, error ctx = None while ctx == None: try: ctx = fedd_ssl_context('server.pem') except Exception, e: if str(e) != "bad decrypt": raise s = server(('127.0.0.1', 8000), ctx) while True: try: i, o, e = select((s,), (), (), 1.0) if s in i: s.handle_request() except error: # The select call seems to get interrupted by signals as well as # the main thread. This essentially ignores signals in this # thread. pass