Require a client program for JSON RPC in C

658 views
Skip to first unread message

Krishna Chaitanya Sanapala

unread,
Sep 3, 2012, 6:21:16 AM9/3/12
to json...@googlegroups.com
Hi Team,

Iam new to JSON RPC. I donno whether there is a JSON RPC implementation in C. Its fine If its written in CPP.

What I am trying to do is rewriting the following code below which is a  JSON RPC client written in Java. into either C++ or C.


 1 public addConfig_snippet() throws IOException  {
 2    final File socketFile = new File("/home/socket.json");
 3    Integer rc = -1;
 4    AFUNIXSocket sock = AFUNIXSocket.newInstance();
 5    try {
 6        sock.connect(new AFUNIXSocketAddress(socketFile));
 7    } catch (AFUNIXSocketException e) {
 8        throw e;
 9    }
10    OutputStream os = sock.getOutputStream();
11    Object[] argx = {"host-host", "192.168.0.102",
12                     "10.10.10.10", "leftfirewall=yes"};
13 JsonRpcClient jrpc = new JsonRpcClient();
14 jrpc.writeRequest("connect", argx, os, "id");
15 os.flush();
16 os.close();
17 }


Experts in the team, please respond . Thanks


Alec Taylor

unread,
Sep 3, 2012, 8:51:25 AM9/3/12
to json...@googlegroups.com
http://json-rpc.org/wiki/implementations 



--
You received this message because you are subscribed to the Google Groups "JSON-RPC" group.
To view this discussion on the web visit https://groups.google.com/d/msg/json-rpc/-/LE2Ptxp94QYJ.
To post to this group, send email to json...@googlegroups.com.
To unsubscribe from this group, send email to json-rpc+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/json-rpc?hl=en.

Etienne Savard

unread,
Sep 3, 2012, 9:17:19 PM9/3/12
to json...@googlegroups.com
Hi,

I think the more up-to-date source for json-rpc implementations is Wikipedia :


Etienne.

Alec Taylor

unread,
Sep 3, 2012, 10:37:43 PM9/3/12
to json...@googlegroups.com
Mmm, but nothing in C on that list

Though admittedly the json-rpc wiki version has fail links for C bridge

Arman Khalatyan

unread,
Sep 4, 2012, 4:47:14 AM9/4/12
to json...@googlegroups.com
Hi,
I just using c++ spirit from boost library to parse json. It is quite neat.

Arman.

Leandro Santiago

unread,
Sep 6, 2012, 11:22:17 AM9/6/12
to json...@googlegroups.com
There's a c++ implementation of jsonrpc in cxxtools libraries, but
it's not ready yet. It doesn't fully suport 2.0 spec yet and it is
able to use both plain-tcp or http as transport.

I'm currently using cxxtools for xmlrpc in production and
experimenting it for jsonrpc and it (almost) works fine. The best part
of cxxtools rpc mechanisms is you don't need to worry about the
protocol, because it creates the stubs (for both client and server)
for you at compile-time.

The only problem is it works only on POSIX enviroments, like Linux,
Mac or Cygwin. The developer doesn't have any plans to make it runs on
Windows.

I suggest you to use the development code, not the releases.

The project page is: http://tntnet.org

If you look at the demos (rpcserver.cpp) you'll see how it's really
easy to build a rpc server with C++ :-)

2012/9/4 Arman Khalatyan <arm...@googlemail.com>:
--
-----
Sent from my Atari
Reply all
Reply to author
Forward
0 new messages