Contents:
bjsonrpc is a pure-python module to connect two peers and call remote procedures (RPC). This implementation resembles JSON-RPC 1.1 with several additions that add more interctivity.
You can have a server, which accepts multiple client connections, or a client which is one connection itself.
The implementation is symmetric/bidirectional. That means that the same things you can do with a server and with a client. You could create a client which waits for server requests.
bjsonrpc provides two helper functions to easily create a server or a connection, linked to a socket:
Creates a bjson.server.Server object linked to a listening socket.
Parameters:
Servers are usually created this way:
import bjsonrpc
server = bjsonrpc.createserver("0.0.0.0")
server.serve()
Check Module bjsonrpc.server documentation
Creates a bjson.connection.Connection object linked to a connected socket.
Parameters:
Connections are usually created this way:
import bjsonrpc
conn = bjsonrpc.connect("rpc.host.net")
print conn.call.some_method_in_server_side()