Question

I start my Erlang node with:

erl -sname erlangNode -cookie secret

P = spawn( fun() -> receive _ -> io:format("gotit") end end).
register(java_server, P).

Then I run my java node client code:

OtpNode node = new OtpNode("bingo", "secret");
OtpMbox mbox = node.createMbox("com");

System.out.println( node.ping("erlangNode@localhost",2000) );

mbox.send("java_server", "localhost",new OtpErlangAtom("hej"));

But the Erlang process java_server never receives the message. What is wrong?

Was it helpful?

Solution

Does your java node outputs true on ping message? Maybe you forgot to write whole node name in send?

mbox.send("java_server", "erlangNode@localhost",new OtpErlangAtom("hej"));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top