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.