Created
November 14, 2018 15:09
-
-
Save otrack/2b5ab474db19a2b05503fb97b8759f48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application:ensure_started(java_erlang), | |
{ok,NodeId} = java:start_node([{add_to_java_classpath,["vcd.jar"]}]), | |
Conf = java:call_static(NodeId,'org.imdea.vcd.Config',parseArgs,[""]), | |
Socket = java:call_static(NodeId,'org.imdea.vcd.Socket',create,[Conf,10]), | |
SentSet = java:call_static(NodeId,'org.imdea.vcd.Generator',messageSet,[Conf]), | |
SentBytes = java:call(java:call(java:call(java:call(SentSet,getMessagesList,[]),get,[0]),getData,[]),toByteArray,[]), | |
io:format("array is ~p~n",[java:array_to_list(SentBytes)]), | |
java:call(Socket,send,[SentSet]), | |
RcvSet = java:call(Socket,'receive',[]), | |
RcvBytes = java:call(java:call(java:call(java:call(SentSet,getMessagesList,[]),get,[0]),getData,[]),toByteArray,[]), | |
io:format("array was ~p~n",[java:array_to_list(RcvBytes)]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment