Erlang Port drivers and Erl_interface

klacke@REDACTED klacke@REDACTED
Thu Jan 27 11:35:59 CET 2005


On Wed, Jan 26, 2005 at 10:06:15PM +0600, casper2000a@REDACTED wrote:
> Hi All,
> 
> With an Erlang Port driver, is it possible to use 
> Erl_interface functions for message 
> Encoding/Decoding? What's the best method to use?
> 


It depends on the complexity/structure of the messages between the
driver and erlang-code. If you want to send structured tuples back
and forth, using erl_interface is a very good option.
On the other hand, if the messages are simple such as:

<<Op:8, Key:16, Data/binary>>

or some such, it may be a lot easier (and more efficent)
to roll your own. Write all code first so that it works
nice and fine through the spawn driver, i.e, don't link
in the driver until the program works. Once it works, you
make a driver out of it. 


I've used both methods.



/klacke



-- 
Claes Wikstrom                        -- Caps lock is nowhere and
http://www.hyber.org                  -- everything is under control          



More information about the erlang-questions mailing list