[erlang-questions] libei use in port drivers

Serge Aleynikov serge@REDACTED
Sat Oct 19 01:30:37 CEST 2013


On Fri, Oct 18, 2013 at 5:45 PM, Thomas Stover <tstover@REDACTED>wrote:

> I suppose I could try to rebuild libei as a shared lib (why isn't it to
> start with?). That feels strange though, because is no one else using
> libei inside a driver? Does everyone just use only manual encoding from
> erlang to C when it comes to drivers. Does everyone just use external
> process ports when they use libei?
>

You can use ei_decode*() family functions inside the driver's *_output()
function, but since those functions deal with decoding Erlang terms from
external binary format, you need to ensure that you use the
term_to_binary(Term) encoding on the Erlang side when you send a message to
the driver.  Since there's a little overhead in that serialization, in
simple cases it may be a bit more efficient to come up with your own binary
encoding/decoding.

Serge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131018/08e4ad88/attachment.htm>


More information about the erlang-questions mailing list