carlalbrecht / socket-json-rpc

An asynchronous JSON-RPC server and client for Clojure that uses sockets for communication
Eclipse Public License 1.0
0 stars 0 forks source link

Can I use this client to read a response from python RPC server? #1

Open temco opened 5 years ago

temco commented 5 years ago

For example, I wrote in serv.py as follows:

from xmlrpc.server import SimpleXMLRPCServer
def is_even(n):
    return n % 2 == 0
server = SimpleXMLRPCServer(("localhost", 8000))
print("Listening on port 8000...")
server.register_function(is_even, "is_even")
server.serve_forever()

And could I build a clojure RPC client to call is_even at localhost:8000

carlalbrecht commented 5 years ago

Hi there!

You certainly can use this library to call RPC server functions implemented in other languages.

However, you appear to be using XML-RPC in Python, rather than JSON-RPC. This won't work. You will either need an XML-RPC client library for Clojure, or a JSON-RPC server library for python.

temco commented 5 years ago

OK, thank you for your help I'll try it

Carl Albrecht notifications@github.com 于2019年6月26日周三 上午6:42写道:

Hi there!

You certainly can use this library to call RPC server functions implemented in other languages.

However, you appear to be using XML-RPC in Python, rather than JSON-RPC. This won't work. You will either need an XML-RPC client library for Clojure, or a JSON-RPC server library for python.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/invlpg/socket-json-rpc/issues/1?email_source=notifications&email_token=AA52C3U6EU4LF23HLIZ3U63P4KNNRA5CNFSM4H24EAW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYRZTLA#issuecomment-505649580, or mute the thread https://github.com/notifications/unsubscribe-auth/AA52C3V5PFADGLF26AX44R3P4KNNRANCNFSM4H24EAWQ .