Remote Procedure Call between Java and C

爱⌒轻易说出口 提交于 2019-12-11 11:54:24

问题


I'm looking for a way to implement RPC between Java and C. What are the options to do this?

Best Wishes

p.s I have web java application which is hosted on Glassfish server and C daemon. I need to directly call functions from bought sides.


回答1:


The whole point of RPC is to let two opaque processes on different systems talk to each other over a network. The languages used are irrelevant, except that you have to learn the corresponding RPC libraries for both languages.




回答2:


Google Protocol Buffers address some of the difficulties with serialization, and provide a "RPC service" abstraction. You'll need to implement the "remote" part -- sending the data across, etc. -- but it'll give you cross-language compatible serialization.

The Google implementation doesn't natively support C -- only C++ -- but it looks like C is one of the languages for which there is an add-on.




回答3:


Another option is the open source "thrift" library (originally from facebook). It also supports generating local stubs in a multiple of languages. Though I suspect the protocol buffer library as suggested by @Louis Wasserman is higher quality than thrift.




回答4:


There are couple of java libraries implementing oncrpc:

http://code.google.com/p/nio-jrpc/ and http://sourceforge.net/apps/trac/remotetea/wiki/WikiStart.



来源:https://stackoverflow.com/questions/9269350/remote-procedure-call-between-java-and-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!