[erlang-questions] Port driver using erl_drv_output_term() to a gen_server:handle_info()
Sat Oct 19 05:58:06 CEST 2013
On Fri, Oct 18, 2013 at 7:34 PM, Michael Truog <mjtruog@REDACTED> wrote:
> It is hard to say what the issue is (from my point of view) with the
> information given. However, there is a way of generating a port driver
> automatically, with async support here: https://github.com/okeuday/GEPD. If you try the example, or look at it, it should help... it is doing an
> async request after a sleep, as shown in the output within the README (and
> you may be able to adapt your source code to use it, to avoid some of the
> port driver details, if that helps you).
I figured it out, I had earlier found that calling driver_mk_port() didn't
work inside of the readyio callbacks, so I call it during driver start, but
I had not stored it properly in my driver data structure. So the value I
was passing into erl_drv_output_term() was in fact garbage (although it
didn't crash the system).
In any case, I found the issue and it all works perfectly now!
Thanks for taking the time to respond.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions