Recent Posts by Armando Di Cianno
|
Dec 18, 2007
Armando Di C...
4 posts
|
Topic: Programming Erlang / 'irc lite' -- can't seem to get it to work
--- chat_client.erl 2007-10-11 14:47:46.000000000 -0400
+++ chat_client.erl.new 2007-12-18 15:23:02.000000000 -0500
@@ -63,7 +63,7 @@
{chan, MM, ack} ->
active(Widget, MM);
Other ->
- io:format("chat_client login unexpected:~p~n",[Other]),
+ io:format("chat_client login unexpected:~p~p~n",[Other,MM]),
wait_login_response(Widget, MM)
end.
@@ -74,7 +74,7 @@
{Widget, Nick, Str} ->
lib_chan_mm:send(MM, {relay, Nick, Str}),
active(Widget, MM);
- {chan, MM, {msg, From, Pid, Str}} ->
+ {chan,MM,{msg,From,Pid,Str}} ->
insert_str(Widget, [From,"@",pid_to_list(Pid)," ", Str, "\n"]),
active(Widget, MM);
{'EXIT',Widget,windowDestroyed} ->
@@ -118,4 +118,4 @@
skip_to_gt(">" ++ T) -> T;
skip_to_gt([_|T]) -> skip_to_gt(T);
-skip_to_gt([]) -> exit("no >").
+skip_to_gt([]) -> exit("no >").
\ No newline at end of file
|
|
Dec 18, 2007
Armando Di C...
4 posts
|
Topic: Programming Erlang / 'irc lite' -- can't seem to get it to work
--- chat_group.erl 2007-10-11 14:47:46.000000000 -0400
+++ chat_group.erl.new 2007-12-18 15:22:31.000000000 -0500
@@ -16,7 +16,7 @@
process_flag(trap_exit, true),
controller(C, self()),
send(C, ack),
- self() ! {chan, C, {relay, Nick, "I'm starting the group"}},
+ self() ! {C, {relay, Nick, "I'm starting the group"}},
group_controller([{C,Nick}]).
@@ -32,14 +32,14 @@
group_controller(L) ->
receive
{chan, C, {relay, Nick, Str}} ->
- foreach(fun({Pid,_}) -> send(Pid, {msg,Nick,C,Str}) end, L),
+ foreach(fun({Pid,_}) -> send(Pid, {msg, Nick, C, Str}) end, L),
group_controller(L);
{login, C, Nick} ->
controller(C, self()),
send(C, ack),
self() ! {chan, C, {relay, Nick, "I'm joining the group"}},
group_controller([{C,Nick}|L]);
- {chan_closed, C} ->
+ {chan_closed,C} ->
{Nick, L1} = delete(C, L, []),
self() ! {chan, C, {relay, Nick, "I'm leaving the group"}},
group_controller(L1);
@@ -47,4 +47,3 @@
io:format("group controller received Msg=~p~n", [Any]),
group_controller(L)
end.
-
|
|
Dec 18, 2007
Armando Di C...
4 posts
|
Topic: Programming Erlang / 'irc lite' -- can't seem to get it to work I found updated chat_group.erl and chat_client.erl here:http://www.erlang.org/pipermail/erlang-questions/2007-August/028358.html Those files seem to fix the issue I was having. |
|
Dec 18, 2007
Armando Di C...
4 posts
|
Topic: Programming Erlang / 'irc lite' -- can't seem to get it to work I’m using the latest erlang release, R12B, and I can’t seem to get the irc lite example to work. Using the code from the unpacked tarball, here’s my output from make chat_server: 1> mod_chat_controller off we go ...<0.35.0> mod_chat_controller off we go ...<0.41.0> mod_chat_controller off we go ...<0.42.0> mod_chat_controller off we go ...<0.45.0> And here’s the output from make chat_client:
1> chat_client login unexpected:{'EXIT',<0.49.0>,connectorFinished}
lib_chan_mm: protocol error:{login,"general","jim"}
chat_client login unexpected:{'EXIT',<0.47.0>,connectorFinished}
lib_chan_mm: protocol error:{login,"general","sue"}
chat_client login unexpected:{'EXIT',<0.45.0>,connectorFinished}
lib_chan_mm: protocol error:{login,"general","jane"}
chat_client login unexpected:{'EXIT',<0.43.0>,connectorFinished}
lib_chan_mm: protocol error:{login,"general","joe"}
Each of the windows has it’s title set to the login accounts’s name and the text “connected to server sending data” is visible. Any text sent generates the following output in the chat_client terminal:
chat_client login unexpected:{<0.44.0>,"jane"," asdf"}
There’s a chance I’m simply missing how to use the ‘irc’ client, but something seems amiss. Any suggestions? |
4 posts
