[erlang-questions] Port driver using erl_drv_output_term() to a gen_server:handle_info()
Sat Oct 19 01:34:56 CEST 2013
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).
On 10/18/2013 03:41 PM, Winston Smith wrote:
> I have port driver that does async [non-blocking] I/O (using driver_select() etc) and on the ready_io READ callback, I'm trying to send data back to the Erlang side using erl_drv_output_term(). Everything seems to work, except that I never see the data on the Erlang side.
> The Erlang side of this is a gen_server that opens the port in it's init() call. The incoming data is asynchronous, so I can't use the port_command()-then-receive idiom -- I was expecting to be able to implement a handle_info() to catch the message, but I just don't see anything on the Erlang side.
> I'm guessing that somehow the port driver owner isn't the same thing as the gen_server, even though I'm doing the port_open() during gen_server:init().
> Any ideas? Thanks,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions