about C Node get global register name

Yu-Teh Shen shenyute@REDACTED
Fri Jul 23 05:53:02 CEST 2010


i try to use C node to connect to an erlang node, and get the global
register names.

but i can not get the name, could anyone tell me why?

C Node:
    erl_init(NULL, 0);
    if (erl_connect_init(1, "aaa", 0) == -1)
        erl_err_quit("erl_connect_init");
    if ((fd = erl_connect("local@REDACTED")) < 0)
        erl_err_quit("erl_connect");

    reply = erl_global_names(fd, &count);
    if (reply) {
        printf("count = %d\n", count);
        for (i = 0; i < count; i++)
            printf("%s\n", reply[i]);
        free(reply);
    }

erlang node 1:
(master@REDACTED)5> global:registered_names().
["GMaster"]

erlang node 2:
(local@REDACTED)2> global:registered_names().
["GMaster"]

Shen, Yu-Teh


More information about the erlang-questions mailing list