[erlang-questions] JInterface, RPC, self()

Robert Virding rvirding@REDACTED
Sat Jan 24 16:46:30 CET 2009


Not directly no. Doing whereis/1 or registered/0 will only work with
registered names on the same node. An quick solution is to do an rpc to
other node and do whereis/1 there and send back the pid. If you intend to
use globally registered names more extensively then I would recommend the
module 'group'.

Robert

2009/1/24 Steven Edwards <cureadvocate@REDACTED>

> Gotcha.  Is there a BIF that translates the tuple into the pid?
>
> Steven
>
> On Fri, Jan 23, 2009 at 9:31 PM, Robert Virding <rvirding@REDACTED>wrote:
>
>> 2009/1/23 Steven Edwards <cureadvocate@REDACTED>
>>
>>> `I still heart Erlang, but we're having some trouble communicating.  I'm
>>> trying to get RPCs to work correctly, but receive {Pid, Result} fails.  I'm
>>> pretty sure that it fails because I use {mbox, simpleserver@REDACTED} as
>>> the initial Pid and JInterface responds with a differently named process
>>> id.  (Same process, but Erlang's representation.)
>>
>>
>> The simple answer is that {mbox,simpleserver@REDACTED} is not the pid of
>> a process, it is a tuple which us interpreted as the registered name on
>> another node. So if the actual pid is returned in the message then it can
>> never match this (or any) tuple.
>>
>> Robert
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090124/64d2b0ed/attachment.htm>


More information about the erlang-questions mailing list