SimpleXMLRPCServer

Maxim Khesin max at cNvOiSsiPoAnMtech.com
Fri Jan 16 18:06:37 CET 2004


Bernhard Mulder wrote:

> Here is an example of a server which runs as long as self.running
> is set:
> 
> class SimpleXMLRPCServer_with_stop(SimpleXMLRPCServer.SimpleXMLRPCServer):
> 
>    def __init__(self, *args, **kwds):
>        self.running = True
>        SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self, *args, **kwds)
> 
>    def serve_while_running_is_set(self):
>       """Server while running is set."""
>       while self.running:
>          self.handle_request()


So putting it in my original terms this would be:

server = SimpleXMLRPCServer(('', 8000))
server.register_instance(MyClass())
while(1)
  if(checkSomeCondidion()):
   server.handle_request()
  else: server.stop()

?
thanks.



More information about the Python-list mailing list