diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-10-14 10:25:44 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-10-14 10:25:44 +0200 |
commit | aa16b66ce4c64dd165292f5fb931d57f09d436d6 (patch) | |
tree | 786631e17528772ec71a6d578a322e2afe23a662 /client | |
parent | 9b5db7ab37a4a2527d523ff39bb0c5525553119e (diff) | |
download | erlang-aa16b66ce4c64dd165292f5fb931d57f09d436d6.tar.gz erlang-aa16b66ce4c64dd165292f5fb931d57f09d436d6.tar.xz erlang-aa16b66ce4c64dd165292f5fb931d57f09d436d6.zip |
removed name in server module
use references for assign the answers to the client
Diffstat (limited to 'client')
-rw-r--r-- | client/client.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/client/client.erl b/client/client.erl index d0bae4c..b1d8b0c 100644 --- a/client/client.erl +++ b/client/client.erl @@ -24,10 +24,8 @@ rpc(Server, Function, Params) -> register(Server, Name, Password) -> rpc(Server, register, [self(), {Name, Password}]), receive - {_, ok, Msg} -> - Msg; - {_, error, Msg} -> - {error, Msg} + {_, Msg} -> + Msg end. login(Server, Name, Password) -> @@ -38,10 +36,10 @@ login(Server, Name, Password) -> _ -> rpc(Server, login, [self(), {node(), Name, Password}]), receive - {_, ok, {ok, {logged_in, {Pid, _}}}} -> - server:registration(Pid, cli), + {ok, {ok, {logged_in, Pid}}} -> + register(cli, Pid), {ok, logged_in}; - {_, _, Msg} -> + {_, Msg} -> Msg; Msg -> Msg |