What is the best approach for IPC between Java and C++?

前端 未结 5 979
日久生厌
日久生厌 2020-12-08 11:52

I would like to implement a robust IPC solution between a single JVM app (one process, potentially multiple threads) and a native C++ application that is linked to a C++ dll

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 12:27

    Have you considered Facebook's Thrift framework?

    Thrift is a software framework for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and OCaml.

    Thrift allows you to define data types and service interfaces in a simple definition file. Taking that file as input, the compiler generates code to be used to easily build RPC clients and servers that communicate seamlessly across programming languages.

    It can work over TCP sockets and the serialization/deserialization is already built-in.

    Read the whitepaper for details.

提交回复
热议问题