0

I need to pass data between c++ program and a Java GUI that is showing that data. I can put that data in a class but the c++ program could be running on linux(raspberry pie) and java may or may not be on windows. What options do i have? Kindly help me for same machine processes and also if they are on different machines. P.S. On different machines internet connection is available.

1
  • 1
    Take a look at Apache Thrift - thrift.apache.org Commented Sep 2, 2013 at 13:37

1 Answer 1

3

You may want to implement some serialization.

I suggest using a simple textual serialization format like JSON (but you might consider also YAML or even XML). There are many JSON libraries available, like jansson (in C), JsonCpp (in C++) and several for Java.

Of course, you need some form of Inter-Process Communication. This can be sockets or pipes. Read e.g. Advanced Linux Programming or some other tutorial. Maybe have some Event Loop (e.g. libev, libevent) or even use JSON-RPC (or perhaps some HTTP server library)

You could use binary serialization like XDR or using libs11n but it is usually not worth the trouble.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 There are many forms for serialization. Any which works across platform will do but text serialization formats are usually easier to understand/read/fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.