[erlang-questions] up-to-date c node not working
Thu Jun 7 00:40:12 CEST 2012
So the instructions for writing a c-node here
http://www.erlang.org/doc/tutorial/cnode.html , although still working are
way out of date ( they don't use the newer ei_connect
I can get the older example code working well but can't however get the
newer ones going .. doing some google-ing it seems people as far back as
2005 have the same issue but nowhere can i find a fix.
As far as i can tell i can successfully connect to a running Erlang node (
"" ) like so :
if (ei_connect_init(&ec, "e1", "secretcookie", n++) < 0)
int fd = ei_connect(&ec, "");
printf("ei_connect error : %d",fd);
seems to work fine, and defiantly fails if i get the cookie wrong etc..
what does not work tho is trying to receive a message :
if (ei_xreceive_msg(fd, &msg, &x) > 0)
// do something
what ever i try ei_xreceive_msg returns -1 .. if it's in a loop (as similar
code found on the net) it will loop non stop and consume 95 % cpu time
is there something simple i am doing wrong ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions