[erlang-questions] Port driver using erl_drv_output_term() to a gen_server:handle_info()

Winston Smith smith.winston.101@REDACTED
Sat Oct 19 00:41:04 CEST 2013

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,

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

More information about the erlang-questions mailing list