[erlang-questions] Sending a large block of binary data from c to erlang

Richard Evans richardprideauxevans@REDACTED
Fri Nov 9 15:31:32 CET 2012


I am using a port to communicate between c and erlang, as described in Joe
Armstrong's excellent book, and in this tutorial:
http://www.erlang.org/doc/tutorial/c_port.html#id63121

So far, the traffic between the two has been pretty small: typically a
hundred bytes or so at a time.

But now I need to (occasionally) send a large block of binary data from c
to erlang: up to 1 meg.

How should I handle such large blocks of binary data? Is there anything
wrong with increasing the size of the buffer (called buf in the tutorial
mentioned above) to 1 meg?

Is there a better way of doing this? (NB I am using a port, rather than a
port-driver (in which the c-code is linked directly to the erlang code)).

thanks,
Richard Evans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121109/a8170d90/attachment.htm>


More information about the erlang-questions mailing list