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

Valentin valentin@REDACTED
Thu Aug 7 23:12:57 CEST 2003


Dear all

C-Node can implement a service that can be accessible from distributed
erlang nodes... I've attached a sample code (a listener class that
illustrates a point -- it cannot be used as it is missing bunch of other
libraries, which I'm not free to disclose at this point).

1)  C-node has to be initialized (done in constructor)
2)  C-node TCP/IP listener is started and registered with EPMD
3)  At this stage, new connection requests may be accepted.
    The connection request will be generated when arbitrary ERTS node
attempts to send a message using the
    following format:

    {ArbitraryName, CNodeNameAtHostName} ! "The arbitrary Message".

4)  Having accepted a connection that came from a particular ERTS, the
connection can be used to receive/send messages,
    (i.e. using int ei_xreceive_msg(int fd, erlang_msg* msg, ei_x_buff* x))

Note: Each ERTS uses a separate connection to communicate with C-Node.

I've tested this quite a while ago, and it worked.

Valentin.





----- Original Message -----
From: "Peter-Henry Mander" <erlang@REDACTED>
To: "Vance Shipley" <vances@REDACTED>
Cc: "Rick Pettit" <rpettit@REDACTED>; <erlang-questions@REDACTED>
Sent: Thursday, August 07, 2003 7:47 PM
Subject: Re: getting erl_interface C program to reply to net_adm:ping/1


> I suspected that much. I initially wanted to fix the ping problem, since
> that made the "pinger" node hang indefinitely when the "pingee" node was
> a C-node which received the ping without replying. That's fixed now,
> thanks for the help everyone.
>
> Would there be any use in me uploading the C code to show as an example?
>
> Pete.
>
> Vance Shipley wrote:
> > Pete,
> >
> > You could in theory have your C-node appear as a fully
> > distributed node but to do so you would have to implement
> > all the functionality of an Erlang runtime system at least
> > as far as distribution goes.  That would be a formidable
> > task.  erl_interface does not attempt to do this but just
> > lets you communicate with a process written in C.
> >
> > -Vance
> >
> >
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verl_listener.cpp
Type: application/octet-stream
Size: 2823 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20030807/78d83ba7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verl_listener.h
Type: application/octet-stream
Size: 1364 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20030807/78d83ba7/attachment-0001.obj>


More information about the erlang-questions mailing list