C interface example

Vance Shipley vances@REDACTED
Thu Oct 7 05:56:13 CEST 1999


Interesting.  I hadn't noticed that you can send using:

	{RegProc,Node} ! Msg

I have been using:

	global:registered_name(Regproc} ! Msg

Now I like the simplicity and elegance of your syntax
but it forces me to know the node that the process runs on.
Why would this be?


}  from Erlang just send a message, e.g: {hello,foo@REDACTED} ! 42
}  Your select should now release so you can do an erl_accept(SockFd)
}  and you'll receive the message '42' sent to the "registered process"
}  'hello' on you node ('foo@REDACTED'). NB: You have to send to a
}  {RegProc,Node} address since you can't create a valid pid from
}  within Erlang. However, if you connect from C to Erlang you
}  can create and send valid pids from C that can be used from 
}  Erlang (using erl_mk_pid() ).

More information about the erlang-questions mailing list