[erlang-questions] Difference between erl_receive and erl_receive_msg
Thu Feb 27 19:11:03 CET 2014
>From memory, I think your interpretation is correct. The _msg function
expects an Erlang message from the distribution layer, not just a simple
binary term. For that you'd need to promote your "simple" C code to be a
proper C node. That's not too difficult and brings further benefits, like
being able to rpc into Erlang from C.
On Feb 27, 2014 4:13 PM, "Alexander Klein" <> wrote:
> 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?
> Kind regards,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions