<div dir="ltr">Hi!<div><br></div><div>The documentation for receiveRPC states:</div><div><br></div><div><div><div>     * Receive an RPC reply from the remote Erlang node. This convenience</div><div>     * function receives a message from the remote node, and expects it to have</div>

<div>     * the following format:</div><div>     *</div><div>     * <pre></div><div>     * { rex, Term }</div><div>     * </pre></div><div>     *</div><div>     * @return the second element of the tuple if the received message is a</div>

<div>     *         two-tuple, otherwise null. No further error checking is</div><div>     *         performed.</div></div></div><div><br></div><div>So it receives whatever message is in the queue and if it's looking like a 'rex' response, it retruns the value; otherwise it returns null. So yes, sometimes the returned value may be null. I usually create a mailbox for each rex request sent - that way it can only receive one message.</div>

<div><br></div><div>The method doesn't even check that the first element is the atom 'rex', which can result in other kind of errors. This I would categorize as a bug.</div><div><br></div><div>regards,</div><div>

Vlad</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 11:07 AM, David Welton <span dir="ltr"><<a href="mailto:davidnwelton@gmail.com" target="_blank">davidnwelton@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Did you ever figure this out?  We're observing some similar behavior<br>
that's a bit odd.  I'm not the one following the Java code, so I will<br>
have to ask for some details, but our Java guy is complaining about<br>
getting null back as well.<br>
<br>
It's likely to have something to do with having both receiveRPC and<br>
other code that also does a receive... at least that's my intuition.<br>
<br>
Any guidance on this?<br>
<div><div class="h5"><br>
On Fri, Sep 7, 2012 at 12:33 PM, Damian Dobroczyński <<a href="mailto:qoocku@gmail.com">qoocku@gmail.com</a>> wrote:<br>
> Hi list!<br>
><br>
> We've found irritating problem with jinterface (R15B01): from time to time<br>
> "receiveRPC()" method returns "null" instead of<br>
> sensible value. After short digging we've found such scenario:<br>
><br>
> ... sendRPC/receiveRPC<br>
> [java] erlang Jinterface says: I got: '{rex,['<a href="mailto:node102@172.16.1.202">node102@172.16.1.202</a>']}'<br>
><br>
> ... sendRPC/receiveRPC<br>
> [java] erlang Jinterface says: I got: '{rex,{jpg,#Bin<32162>}}'<br>
><br>
> ... sendRPC/receiveRPC<br>
> [java] erlang Jinterface says: I got: '{rex,['<a href="mailto:node102@172.16.1.202">node102@172.16.1.202</a>']}'<br>
><br>
> ... sendRPC/receiveRPC<br>
> [java] erlang Jinterface says: I got:<br>
> '{'$gen_call',{#Pid<node106@172.16.1.206.1179.0>,#Ref<node106@172.16.1.206.15149.0.0>},{is_auth,'<a href="mailto:node106@172.16.1.206">node106@172.16.1.206</a>'}}'<br>
><br>
> ...<br>
><br>
> (we've changed "receiveRPC" method to produce log entries)<br>
><br>
> "{rex, ...} messages are OK. The last one is suprising. Is it proper<br>
> behavior? I mean, does a Java node receive occasionally "is_auth" messages<br>
> (I think they are related somehow to net_kernel module) ? "node6" IS the<br>
> node we're connected to.<br>
><br>
> -- D.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
David N. Welton<br>
<br>
<a href="http://www.welton.it/davidw/" target="_blank">http://www.welton.it/davidw/</a><br>
<br>
<a href="http://www.dedasys.com/" target="_blank">http://www.dedasys.com/</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></span></blockquote></div><br></div>