<div>Hi,</div><div><br></div><div>From the erlang docs, the method for sending data to a C program is:<br></div>receive<br> {call, Caller, Msg} -><br> Port ! {self(), {command, encode(Msg)}},<br> receive<br> {Port, {data, Data}} -><br>
Caller ! {complex, decode(Data)}<br> end,<br> loop(Port);<br><br>This means a message sent to the Port with "command" goes to the STDIN of the C prog and the C prog responds with "data". <br>
<br>Is it possible and customary to use the same mechanism to have a C program INITIATE calls to an Erlang module? Is it common to have C programs invoke Erlang functions by sending a "data" on STDOUT and waiting for the response on STDIN?<br>
<br>Thanks,<br>Yash<br>