<p>Hi David,</p>
<p>one potential pitfall with C nodes in general, regardless of pure message based or erl_rpc, comes when your C node does something time consuming. That is, your C node is not responding to ERL_TICK in a timely fashion. The connected Erlang nodes will then think that the C node has become disconnected.</p>
<p>It is possible to recognise this situation from within the C node and explicitly reconnect to an Erlang node. I'm away from my work just now, but if you want an example, let me know and I'll send something round tomorrow.</p>
<p>Alternatively, your C node can use threading to handle messages. That goes beyond my abilities ;-)</p>
<p>Robby</p>
<p>--<br>
Sent from a mobile device, please excuse the typos.<br>
</p>
<div class="gmail_quote">On Jan 16, 2013 11:03 AM, "David Welton" <<a href="mailto:davidnwelton@gmail.com">davidnwelton@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
I'm trying to wrap my head around the "best" way to set up an<br>
OTP-based system that comunicates with a C node.<br>
<br>
My inclination so far is to set up a gen_server, and use handle_info/2<br>
to deal with messages coming from the C node.<br>
<br>
Looking at the C node example, it's all about messages, which seems to<br>
be "the simplest thing that could possibly work", which is good. I'm<br>
wondering, though, if it makes more sense to try and call directly<br>
into my gen_server's api with rpc, along the lines of what is being<br>
done here:<br>
<br>
<a href="http://stackoverflow.com/questions/4749693/can-i-get-erlang-otp-behaviors-in-c-nodes" target="_blank">http://stackoverflow.com/questions/4749693/can-i-get-erlang-otp-behaviors-in-c-nodes</a><br>
<br>
Any other tips/tricks/best practices/pitfalls to avoid would be welcome.<br>
<br>
Thanks,<br>
--<br>
David N. Welton<br>
<br>
<a href="http://www.welton.it/davidw/" target="_blank">http://www.welton.it/davidw/</a><br>
<br>
<a href="http://www.dedasys.com/" target="_blank">http://www.dedasys.com/</a><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>
</blockquote></div>