Changeset 548 for trunk/daemon/orbited/start.py
- Timestamp:
- 10/10/08 08:26:54 (3 months ago)
- Files:
-
- 1 modified
-
trunk/daemon/orbited/start.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/orbited/start.py
r545 r548 25 25 reactor.listenWith(port_class, factory=factory_class(), resource=root, childName=child_path) 26 26 logger.info('%s protocol active' % config_key) 27 27 28 28 def _setup_static(root, config): 29 29 from twisted.web import static … … 46 46 global logger; logger = logging.get_logger('orbited.start') 47 47 48 48 49 # NB: we need to install the reactor before using twisted. 49 50 reactor_name = config.map['[global]'].get('reactor') … … 61 62 static_files = static.File(os.path.join(os.path.dirname(__file__), 'static')) 62 63 root.putChild('static', static_files) 64 #static_files.putChild('orbited.swf', static.File(os.path.join(os.path.dirname(__file__), 'flash', 'orbited.swf'))) 63 65 site = server.Site(root) 64 66 … … 70 72 def start_listening(site, config, logger): 71 73 from twisted.internet import reactor 74 # allow stomp:// URIs to be parsed by urlparse 75 urlparse.uses_netloc.append('stomp') 76 72 77 for addr in config['[listen]']: 73 78 url = urlparse.urlparse(addr) 74 79 hostname = url.hostname or '' 75 if url.scheme == 'http': 80 if url.scheme == 'stomp': 81 logger.info('Listening stomp@%s' % url.port) 82 from morbid import StompFactory 83 reactor.listenTCP(url.port, StompFactory(), interface=hostname) 84 elif url.scheme == 'http': 76 85 logger.info('Listening http@%s' % url.port) 77 86 reactor.listenTCP(url.port, site, interface=hostname)