<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 20, 2013 at 11:47 AM, James Aimonetti <span dir="ltr"><<a href="mailto:james@2600hz.com" target="_blank">james@2600hz.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":f5" style="overflow:hidden">rpc/2 expects the first arg into the function to be the first element<br>

in the response tuple.<br>
The loop/0 uses self(), which always returns a pid(), not the<br>
registered name.<br>
So you call rpc with an atom, and receive a tuple with a pid(). Those<br>
don't match.<br>
Your call to rpc/2 hangs because the selective receive in rpc/2 never<br>
matches (and you have no timeout clause).</div></blockquote></div><br><div class="gmail_extra">What's confusing is that the atom apparently resolves into a pid() in the send expression of kvsx:rpc/2 (adding io:format("reg name = ~p~n", [whereis(abc)]) to the function returns the pid()), but not in the pattern tuple of the receive expression.<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">Anyway, thanks for the replies James and Yogish.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ed</div></div></div>