[erlang-questions] How to get pid of remote registered process

Vlad Dumitrescu vladdu55@REDACTED
Thu May 14 08:50:37 CEST 2009


On Wed, May 13, 2009 at 23:29, tsuraan <tsuraan@REDACTED> wrote:
> I have a JNode with a mailbox that has a registered name.  I can send
> messages to this mbox using the { name, node@REDACTED } ! msg syntax, but
> I can't figure out how to get the actual pid of { name, node@REDACTED }.
> It looks like what's been recommended in the past is to use
> rpc:call(node@REDACTED, erlang, whereis, [ name ]), but that doesn't work
> on JNodes.  Is there a different way to get the pid of a remote
> process?

Hi,

AFAIK, there is no builtin way to do this in jinterface. You have
several options:
- implement a name registry yourself in Java and use it to retrieve the pid,
- let the mailbox answer to a message of 'whats_your_pid_dude' (or
whatever :-) with the right value
- when creating the mailbox, send the pid to some process on the erlang side

regards,
Vlad



More information about the erlang-questions mailing list