Hi All<br>I am trying to write a C node and call erl_publish in the C code. However this function always returns -1. I am trying to find the possible reasons for this. Would really appreciate it if someone could educate me on this. My code is below<br>
<br> int sockfd;<br><br>  ErlConnect erlc;<br>  int fd;<br>  int identification_number = 1;<br>  int creation=1;<br>  char *cookie="cookie"; /* An example */<br>  string errcom;<br>  int port = atoi(argv[1]);<br>
  printf("THe port is %d,",port);<br><br>  try {<br>    erl_init(NULL, 0);<br><br>    if (erl_connect_init(identification_number, cookie,creation) == -1)<br>      erl_err_quit("erl_connect_init");<br><br>
    //fprintf(stderr, "connected\n");<br>    if ((sockfd = my_listen(PORT)) <= 0)<br>      erl_err_quit("error: my_listen");<br><br>    // fprintf(stderr, "listening\n");<br>    printf("PORT is %d",PORT);<br>
    if ( erl_publish(PORT) == -1)<br>      erl_err_quit("error: publish");<br>