In this expression:
Expr1! Expr2
Expr1 must evaluate (1) pid , (2) the registered name (atom), or (3) the tuple {Name, Node} .
In the third case, as you wanted to know, when Expr1 evaluates the tuple {Name, Node} , the name is the registered name (atom) of the process and Node is the name Node (also an atom), for example name @server.
For instance:
% ------- in your node ------- ( you@server )> register(shell, self()). % ------- in my node ------- ( me@server )> {shell, you@server } ! "hey you!".
Please note that before sending a message to other processes in other nodes, you must first connect to them. For example, using spawn (Node, Module, Function, Arguments) or net_adm: ping (Node) .
For testing purposes, use the nodes () function for a list of connected nodes.
source share