getting erl_interface C program to reply to net_adm:ping/1

Peter-Henry Mander erlang@REDACTED
Thu Aug 7 18:54:01 CEST 2003


Hi Rick,

I have found that now my C-node replies to net_adm:ping/1 it only 
appears in the hidden node list. In order to communicate with a C-node, 
epmd must be running, and any other Erlang-node can send and receive 
messages to the C-node. So running epmd is not sufficient.

The phrase "register themselves with epmd" seems to imply more than 
simply being pingable. The C function erl_publish is used to "register 
with the local name server epmd", but even though I do this, the C-node 
remains hidden, and only appears in the hidden node list after a ping.

Should I be using erl_global_register? What Pid should I give to 
globally register a C-node under a name? What kind of process id can a 
C-node have? The example in chapter 1.1.10 gives an example:

   pid = erl_mk_pid(thisnode,14,0,0);
   erl_global_register(fd,servicename,pid);

Apparently the number, serial, and creation values (14,0,0) are 
arbitrary. I'll try this and give some feedback.

Pete.

Rick Pettit wrote:
> On Mon, Aug 04, 2003 at 02:08:36PM +0100, Peter-Henry Mander wrote:
> 
>>Also, what is involved in making a 'C' node behave like a visible node 
>>instead of a hidden one?
> 
> 
> Haven't gotten that far yet but the docs (Erl Interface User's Guide) seem to
> say:
> 
> 1.7 Using EPMD
> 
> Epmd is the Erlang Port Mapper Daemon. Distributed Erlang nodes register with
> epmd on the localhost to indicate to other nodes that they exist and can accept
> connections. Epmd maintains a register of node and port number information, and
> when a node wishes to connect to another node, it first contacts epmd in order
> to find out the correct port number to connect to.
> 
> When you use erl_connect() to connect to an Erlang node, a connection is first
> made to epmd and, if the node is known, a connection is then made to the Erlang
> node.
> 
> *** C nodes can also register themselves with epmd if they want other nodes in
>     the system to be able to find and connect to them. ***
> 
> I put ***'s around the pertinent part. Seems to indicate that the node is no
> longer "hidden", but again I have not yet tested this. I will try get back to
> you when I have.
> 
> -Rick
> 
> 






More information about the erlang-questions mailing list