def __init__(self, host, port): """create a XML-RPC server Takes two initial inputs: host -- hostname of XML-RPC server host port -- port number for server requests """ Server.__init__(self) SimpleXMLRPCDispatcher.__init__(self, allow_none=False, encoding=None) self._installSocket(host, port) self._activeProcesses = {} # { fd : pid }
def __init__(self, host, port): '''create a XML-RPC server Takes two initial inputs: host -- hostname of XML-RPC server host port -- port number for server requests ''' Server.__init__(self) SimpleXMLRPCDispatcher.__init__(self, allow_none=False, encoding=None) self._installSocket(host, port) self._activeProcesses = {} #{ fd : pid }
def serve(self): """enter the select loop... and wait for service requests""" timeout = 5 Server.serve(self, 5)
def activate(self): """install callbacks""" Server.activate(self) self._selector.notifyOnReadReady(self._socket, self._onConnection) self._selector.notifyWhenIdle(self._onSelectorIdle)