[erlang-questions] How can i evaluate gen_server:call/cast cross nodes?

wenew zhang <>
Wed Apr 2 02:06:30 CEST 2008


It's  works  on erl shell:

 Pid=global:whereis_name(authserver).
<5661.50.0>
()5> Uid=list_to_binary("root").
<<"root">>
()6> Pwd=list_to_binary("12345").
<<"12345">>
()12>
Result=gen_server:call(Pid,{213,Uid,Pwd}).
0%% the normal result

Code examples:
            io:format("rcv:~w AuthPid~w ~n",[Data,State#state.authsrv]),
            %global:sync(),
            Result=gen_server:cast(State#state.authsrv,{?PLLOGIN,Uid,Pwd}),
%%even no data send to the authsrv,
            io:format("Result:~w~n",[Result]),

Error Mesage:________________begin_________________________________________
rcv:<<0,4,97,115,100,102,0,5,115,97,102,115,100>> AuthPid{<5661.50.0>}   %%
the authsrv Pid
=ERROR REPORT==== 2-Apr-2008::08:02:35 ===
** State machine <0.58.0> terminating
** Last message in was {tcp,#Port<0.115>,
                            <<0,6,97,97,115,97,97,97,0,5,98,98,98,98,98>>}
** When State == 'WAIT_FOR_DATA'
**      Data  == {state,#Port<0.115>,{192,168,0,221},{<5661.62.0>}}
** Reason for termination =
** {{function_clause,[{gen,call,
                           [{<5661.62.0>},
                            '$gen_call',
                            {213,<<"aasaaa">>,<<"bbbbb">>},
                            5000]},
                      {gen_server,call,2},
                      {indexserver,'WAIT_FOR_DATA',2},
                      {gen_fsm,handle_msg,7},
                      {proc_lib,init_p,5}]},
    {gen_server,call,
                [{<5661.62.0>},{213,<<"aasaaa">>,<<"bbbbb">>}]}}
_______________end________________________________
What's problem with it?

Best Regards

Wenew Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080402/47f41be0/attachment.html>


More information about the erlang-questions mailing list