Failed to see this mentioned anywhere in the documentation but if a node remote communicate with another node can the receiving node respond to the sending node simply by using the PID contained in the "From" variable?
Asked
Active
Viewed 38 times
1 Answers
3
Yes, see the documentation for erlang:send/2,3
, which says:
Dest may be a remote or local pid, a (local) port, a locally registered name, or a tuple {RegName, Node} for a registered name at another node.
Here, Dest
refers to the destination of the message, and I highlighted the word "remote" in bold to show that a destination PID can refer to a remote process.

Steve Vinoski
- 19,847
- 3
- 31
- 46
-
Great, makes thing easier. Thought I had to send the machine as an extra param. – David S Jul 31 '15 at 21:32
-
Sorry for asking in the same thread but how does a node fetch its own machine name? – David S Aug 02 '15 at 19:06
-
That would be hard to fully answer in a comment. See [net_kernel](http://www.erlang.org/doc/man/net_kernel.html) and [net_adm](http://www.erlang.org/doc/man/net_adm.html) for some details, and [this SO answer](http://stackoverflow.com/a/24928855/409228) is helpful too. – Steve Vinoski Aug 03 '15 at 11:30