<div dir="auto"><div>I don't have the docs in front of me at the moment, but if I remember correctly you need to have the message receive loop running continuously, which handles the inter Erlang node pings for you. You can then monitor the C node from Elixir and get a message if a ping was not answered in a timely fashion.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, 3 Sep 2018 13:27 Damien Towning, <<a href="mailto:connolly.damien@gmail.com">connolly.damien@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Everyone, <div><br></div><div>I have a cnode written in C that performs some complex geometrical operations. The code is non blocking but I am wondering what the best way is to establish a keep alive poll back as return time for the cnode could be anywhere from a few seconds to hours. The cnode on the Erlang side is in elixir but I think this is really more an Erlang question than an Elixir one. I have something like this </div><div>on the Erlang/Elixir side </div><div><br></div><div><div> Nodex.Distributed.up()</div><div>    {conn, pid} = Cnode.start_link(%{exec_path: "bin/brep" , spawn_inactive_timeout: :infinity } )</div></div><div> Cnode.call(pid, msg  )<br clear="all"><div><br></div><div>And then something like this on the c code side </div><div><br></div><div><div> else if ( erl_match(erl_format("blah"),operation) ) { </div><div>    std::vector<double> para(3); </div><div>    ETERM *parameters = erl_element(2,emsg->msg);</div><div>    para = list_to_vectors( parameters ); </div><div>    cylinder(para[0],para[1],para[2]);  </div><div>    response = erl_mk_int( geometry.currentIndex() ); </div><div>    erl_free_term(parameters);</div><div>  }</div></div><div><br></div><div>My code does not block and I can regularly send messages back. I am just not sure what to send back as a regular wake up call. </div><br><div dir="ltr" class="m_1610956396790879201gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="color:rgb(136,136,136);font-size:12.8px"> </span><br></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank" rel="noreferrer">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div>