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?

Était-ce utile?

La 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"));
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top