14

Given that I can send PIDs from a process to an other, even across nodes, if I receive a Pid from a process within a different process (possibly on a different node) how do I find out which node the PID in question runs in/on?

erlang:process_info(Pid) does not seem to have that information in it.

Thanks.

2240
  • 1,547
  • 2
  • 12
  • 30
pgdad
  • 141
  • 1
  • 3

1 Answers1

18

erlang:node/1

node(Arg) -> Node

Returns the node where Arg is located. Arg can be a pid, a reference, or a port. If the local node is not alive, nonode@nohost is returned.

Community
  • 1
  • 1
Pindatjuh
  • 10,550
  • 1
  • 41
  • 68