<div dir="ltr">You didn't connect to target node.<div>Have to call net_adm:ping(Node) first to connect.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 8, 2016 at 3:47 PM, YuanZhiqian <span dir="ltr"><<a href="mailto:on-your-mark@hotmail.com" target="_blank">on-your-mark@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hi guys,<div><br></div><div> I was trying to call gen_server:cast from a escript file, everything that used to work well in erl shell won't work in escript, I have no idea what made the difference, here is the code, could anyone help me to find a clue? </div><div><br></div><div><br></div><div><br></div><div><div>#!/usr/bin/env escript</div><div><br></div><div>%%! -name bk@test -setcookie budget_keeper</div><div><br></div><div>main(Argv) -></div><div> {Node, File} = case Argv of</div><div> [] -></div><div> <b>{'<a href="mailto:budget_keeper@127.0.0.1" target="_blank">budget_keeper@127.0.0.1</a>', "cache"</b>};</div><div> [F] -></div><div> {'<a href="mailto:budget_keeper@127.0.0.1" target="_blank">budget_keeper@127.0.0.1</a>', F};</div><div> [N, F] -></div><div> {N, F}</div><div> end,</div><div> io:format("~p ~p ~p ~p~n", [node(), erlang:get_cookie(), Node, File]),</div><div> gen_server:cast({bk_main, Node}, {dump_data, File}).</div></div><div><br></div><div><br></div><div><br></div><div>As shown above, the target process is called "bk_main" which is on the node '<a href="mailto:budget_keeper@127.0.0.1" target="_blank">budget_keeper@127.0.0.1</a>', I have run the same code in erl shell, and bk_main can get the notice, but nothing happened when I ran the same code in this script.</div><div><br></div><div>Best regards</div><div>Zhiqian</div> </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" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Park, Sungjin<div>-------------------------------------------------------------------------------------------------------------------</div><div>Peculiar travel suggestions are dancing lessons from god.</div><div> -- The Books of Bokonon</div><div>-------------------------------------------------------------------------------------------------------------------</div></div>
</div>