Skip to content

daizhaolin/udsxmlrpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

udsxmlrpc

Unix domain socket XML-RPC

Installing

Install and update using pip:

pip install -U udsxmlrpc

Server Simple Example

from udsxmlrpc import Server

s = Server('/tmp/udsxmlprc.sock')

s.register_introspection_functions()
s.register_function(pow)

def adder_function(x, y):
    return x + y

s.register_function(adder_function, 'add')


class MyFuncs:
    def mul(self, x, y):
        return x * y


s.register_instance(MyFuncs())
s.serve_forever()
$ python server.py

Client Simple Example

from udsxmlrpc import Client

s = Client('/tmp/udsxmlprc.sock')

print(s.pow(2, 3))
print(s.add(2, 3))
print(s.mul(5, 2))

print(s.system.listMethods())
$ python client.py
8
5
10
['add', 'mul', 'pow', 'system.listMethods', 'system.methodHelp', 'system.methodSignature']

Thanks

image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages