<div dir="ltr">Hello,<div><br></div><div>The only way that I know if from either driver_caller or driver_connected. What I have done to solve this problem is to make the process that should get the message "register" with the port. When it does the register call I get the pid using driver_caller and save the pid in the port state.</div>
<div><br></div><div>You should probably also monitor the process from the driver to in case it terminates.</div><div><br></div><div>Lukas</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 2:02 PM, <a href="mailto:streamingmind@gmail.com">streamingmind@gmail.com</a> <span dir="ltr"><<a href="mailto:streamingmind@gmail.com" target="_blank">streamingmind@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt"><div><div><p style="margin-top:0;margin-bottom:0"><u></u>Hi all,</p></div></div><div style="font-size:10pt">
<div><div><p style="margin-top:0;margin-bottom:0"> </p><p style="margin-top:0;margin-bottom:0">I've been practicing writing a port driver for a legacy SIGTRN product. In attempting to send back data from the port driver to a erlang process, I don't know how to convert existing  erlang_pid data to a ErlDrvTerm data which is required by erl_drv_send_term(), as the receiver parameter. It'll be graceful if somebody here could give me a hand.</p>
<p style="margin-top:0;margin-bottom:0"> </p><p style="margin-top:0;margin-bottom:0">Regards,</p><p style="margin-top:0;margin-bottom:0">Ben</p></div></div><p style="margin-top:0;margin-bottom:0"> </p></div></div><br>_______________________________________________<br>

erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>