ErlMessage emsg; emsg.type == 0

Vance Shipley vances@REDACTED
Tue Nov 13 23:13:45 CET 2001


I'm having trouble with erl_interface on R8B.  I'm porting some
code written with the erl_interface library, not ei standalone.

The examples in the tutorial don't work either.  

cnode_s.c:
  ErlMessage emsg;                         /* Incoming message */
...
	got = erl_receive_msg(fd, buf, BUFSIZE, &emsg);
	if (got == ERL_TICK) {
	/* ignore */
	} else if (got == ERL_ERROR) {
		loop = 0;
	} else {

      if (emsg.type == ERL_REG_SEND) {
      ...                               <-----  *** NOT REACHED ***
      }
    }

In all cases (emsg.type == 0).  If you ignore this there is in fact
a valid message there, the rest of the structure has been filled in
approriately, as far as I can tell.


typedef struct {
  int type;
  ETERM *msg;
  ETERM *to;
  ETERM *from;
  char to_name[MAXREGLEN];
} ErlMessage;
        

	-Vance


Vance Shipley
Motivity Telecom Inc.
+1 519 579 5816




More information about the erlang-questions mailing list