[erlang-questions] Difference between erl_receive and erl_receive_msg
Thu Feb 27 14:54:28 CET 2014
today I tried to connect Erlang to a C-backend I'm just writing:
On the Erlang-side I create a port ...
... to which I can send some data ...
... and decode the data on the C-side with:
status = erl_receive ( 3, buffer, BUFFER );
/* a few lines snipped */
input = erl_decode ( buffer );
This approach works quite well, so far.
Trying to decode with erl_receive_msg, however, never worked, since this
function would throw an error immediately.
On the other hand, the latter is the method used in the example on page
343 of the book by Cesarini & Thompson.
The only thing that's different to the example is the fact that I don't
do any of the erl_connect...-stuff used there, because the backend isn't
supposed to be used by any other nodes, anyway.
What am I missing?
More information about the erlang-questions