[erlang-bugs] Allow C nodes to be visible

Paul Guyot <>
Mon Jan 19 23:11:41 CET 2009


Hello,

C nodes have limited functionalities. Some capabilities can be  
implemented using the current ei_connect interface, but these  
capabilities are not advertised when the node is connected to other  
nodes. In particular, C nodes are always hidden, and this prevents the  
inclusion of a global name service or of process groups, among other  
things.

The attached patch is a minimal change to allow visible C nodes. The  
ei_connect and ei_accept are provided with a new variant that takes a  
flags parameter that determines which capabilities are to be exposed  
upon connection to a particular node.

The new functions are:

int ei_connect_tmo_flags(ei_cnode* ec, char *nodename, unsigned ms,  
unsigned flags);
int ei_xconnect_tmo_flags(ei_cnode* ec, Erl_IpAddr adr, char  
*alivename, unsigned ms, unsigned flags);
int ei_accept_tmo_flags(ei_cnode* ec, int lfd, ErlConnect *conp,  
unsigned ms, unsigned flags);

All other functions have exactly the same behavior. In particular, the  
default flags are passed as they used to be whenever the original  
functions are used. To make a C node visible, the caller just needs to  
pass the default set of flags or-ed with DFLAG_PUBLISHED.

I realize the proposed patch is minimalistic and the interface is very  
rough. There are two reasons. First, providing flags to ei_connect*  
and ei_accept* functions is experimental. It has many consequences,  
and a simple "visible" boolean would probably make the API user  
believe that making a C node visible is as simple as passing true,  
which of course it isn't. Second, a full implementation of the  
required protocols, including the global protocol, in C, would imply a  
large development we do not plan to undertake (our implementation is  
not in C) and a high maintenance cost. As a result, it seemed that a  
minimalistic, backward compatible and coherent change, is the easier  
to include upstream. Yet, we believe that such a patch would be useful  
for parallel efforts that consists in bridging erlang with other  
languages (e.g. .NET).

Regards,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-connect-flags.diff
Type: application/octet-stream
Size: 5671 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20090119/f97b8611/attachment.obj>
-------------- next part --------------



More information about the erlang-bugs mailing list