[erlang-questions] Strange error with client/server IRC code

Ladislav Lenart lenartlad@REDACTED
Thu Feb 28 09:50:31 CET 2008


Berlin Brown wrote:
> I get this error
> 
> trace: irc_lib.invoke cast(2){"init terminating in
> do_boot",{function_clause,[{gen_server,cast,[{ok,<0.29.0>},{irc_send_command,{"JOIN"}}]},{simple_irc_lib,test,0},{init,start_it,1},{init,start_em,1}]}}
> 
> Here is my test case and some of my function tracing:
> 
> This is the call:
> ------
> 
>    P = irc_lib:start_link(#irc_client_info{realname="foo",
> 											nick="ort_test",
> 											handler=self(),
> 											servers=[{"irc.freenode.org", 6667}]}),
> 	io:format("irc_lib:start_link ->~p ~n", [P]),
> 	timer:sleep(18000),
> 	irc_lib:join(P, "erlang"),
> 	timer:sleep(10000),

Hello,

I think the error is in the test itself. irc_lib:start_link/X
returns {ok, Pid} but irc_lib:join/X (resp. gen_server:cast/X)
expects just the pid.

HTH,

Ladislav Lenart





More information about the erlang-questions mailing list