Changeset 293
- Timestamp:
- 06/23/08 00:38:27 (2 months ago)
- Location:
- branches/0.5/daemon/orbited
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.5/daemon/orbited/config.py
r292 r293 24 24 25 25 defaults = { 26 '[global]': { 27 'dispatch.enabled': '1', 28 'dispatch.port': '9000' 29 }, 26 30 '[access]': [ 27 31 ('localhost', 9998), # Allow WebSocket test daemon -
branches/0.5/daemon/orbited/dispatch.py
r292 r293 2 2 from twisted.internet.protocol import Protocol, Factory 3 3 from twisted.internet import reactor 4 from config import map as config 5 from logger import get_logger 4 6 5 7 logger = get_logger('Dispatch') 6 8 7 9 class DispatchConnection(TCPConnection): … … 36 38 37 39 def __init__(self, *args, **kwargs): 38 TCPConnectionFactory.__init__(self, *args, **kwargs) 39 self.dispatch_connections = {} 40 self.factory = DispatchProtocolFactory(self) 41 reactor.listenTCP(9000, self.factory) 40 TCPConnectionFactory.__init__(self, *args, **kwargs) 41 self.dispatch_connections = {} 42 self.factory = DispatchProtocolFactory(self) 43 port = int(config['[global]']['dispatch.port']) 44 logger.info('Listening Orbit@%s (legacy dispatch protocol)' % port) 45 reactor.listenTCP(port, self.factory) 42 46 43 47 def receive_frame(self, conn, headers, body): … … 70 74 self.root = root 71 75 self.protocol = DispatchProtocol 76 72 77 def buildProtocol(self, addr): 78 logger.access('Dispatch [ %s ] ' % (addr,)) 73 79 return DispatchProtocol(self.root.receive_frame) 74 80 -
branches/0.5/daemon/orbited/start.py
r292 r293 24 24 root.putChild('binaryproxy', BinaryProxyFactory()) 25 25 root.putChild('websocket', WebSocketFactory()) 26 root.putChild('legacy', DispatchFactory()) 26 if config['[global]']['dispatch.enabled'] == '1': 27 root.putChild('legacy', DispatchFactory()) 28 27 29 for addr in config['[listen]']: 28 30 url = urlparse.urlparse(addr)