jinterface

Java to Erlang messages

北城以北 提交于 2019-12-30 08:45:08
问题 I'm making a application in Erlang, with a GUI in Java. I've managed to establish a connection between the to languages, but now i need to (i guess) send a message from Java to Erlang, every time I e.g press a button. Is that the right way to go? How would such a message look? I've found a few good sites about this form of integration, but I feel like im not getting everything. http://www.trapexit.org/How_to_communicate_java_and_erlang 回答1: If jinterface is too complicated you might just use

jInterface to create External Erlang Term

℡╲_俬逩灬. 提交于 2019-12-14 02:25:09
问题 How can I format the the following erlang term: { atom, "message" } In jInterface to an external format that I may call in an erlang shell erlang:binary_to_term( Binary ) Example: Note that since the tuple will be sent over the net, I finish by converting to byte[]. OtpErlangObject[] msg = new OtpErlangObject[2]; msg[0] = new OtpErlangAtom( "atom" ); msg[1] = new OtpErlangString( "message" ); OtpErlangTuple reply = new OtpErlangTuple(msg); OtpOutputStream stream = new OtpOutputStream(reply);

Java to Erlang messages

送分小仙女□ 提交于 2019-12-01 05:20:20
I'm making a application in Erlang, with a GUI in Java. I've managed to establish a connection between the to languages, but now i need to (i guess) send a message from Java to Erlang, every time I e.g press a button. Is that the right way to go? How would such a message look? I've found a few good sites about this form of integration, but I feel like im not getting everything. http://www.trapexit.org/How_to_communicate_java_and_erlang If jinterface is too complicated you might just use the packet option on open_port and use byte[] in_buf = new byte[256]; byte[] out_buf = new byte[256]; int in