The sample apps described in the bug

-Joe

import xmlrpclib

class SampleClient(xmlrpclib.ServerProxy):
    def __init__(self, host, port):
        xmlrpclib.ServerProxy.__init__(self, 'http://%s:%s' % (host,port))

if __name__ == '__main__':
    client = SampleClient("localhost",5005)
    print client.TestAPI("boo")

import sys
import SimpleXMLRPCServer
import xmlrpclib
import SocketServer

class SampleServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer.SimpleXMLRPCServer):
    allow_reuse_address = 1
    allow_dotted_names = 1

    def __init__(self, port, working, host='localhost'):
        SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self, (host,port))
        self.allow_dotted_names=1
	if working:
	        self.register_instance(SampleAPI())
	else:
	        self.register_instance(SampleAPI(), allow_dotted_names=True)
        self.allow_dotted_names=1

class SampleAPI:
    def TestAPI(self, sampleParam):
        print sampleParam
        return sampleParam

if __name__ == '__main__':
	if sys.argv[1] =="1":
		working = SampleServer(5005,1)
		working.serve_forever()
	else:
		broken = SampleServer(5005,0)
		broken.serve_forever()

Reply via email to