aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-10-15 11:51:49 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-10-15 11:51:49 +0200
commitb91af95d1ef5fc893c3db784e9ab6df2c28b4638 (patch)
tree2ac3152cce9a22ec1faf6a02c7d2ac4b3c1963f6 /client
parent3c11d5040d2d38616a51aa562ac94e251aa69f6a (diff)
downloaderlang-b91af95d1ef5fc893c3db784e9ab6df2c28b4638.tar.gz
erlang-b91af95d1ef5fc893c3db784e9ab6df2c28b4638.tar.xz
erlang-b91af95d1ef5fc893c3db784e9ab6df2c28b4638.zip
removed register/2 and login/2 from dispatcher (now direct call to dis)
Diffstat (limited to 'client')
-rw-r--r--client/client.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/client/client.erl b/client/client.erl
index 43dbfc6..ee9421f 100644
--- a/client/client.erl
+++ b/client/client.erl
@@ -15,9 +15,9 @@ buildNode(Server) ->
%% build the node string of the server by using the hostname
list_to_atom("distributed_music_system_main_node@" ++ Server).
-rpc(Server, Function, Params) ->
- %% shortcut for calling a function from the server
- rpc:call(buildNode(Server), dispatcher, Function, Params).
+rpc(Server, Params) ->
+ %% shortcut for sending something to the dispatcher on the server
+ {dis, buildNode(Server)} ! {self(), Params}.
register(Server, Name, Password) ->
%% check if client is not logged in (if client is logged in,
@@ -25,7 +25,7 @@ register(Server, Name, Password) ->
try checkLogin(false) of
_ ->
%% register a new user account on the server
- rpc(Server, register, [self(), {Name, Password}])
+ rpc(Server, {register, {Name, Password}})
catch
{error, login_state} ->
{error, logged_in}
@@ -52,7 +52,7 @@ login(Server, Name, Password) ->
try checkLogin(false) of
_ ->
%% login to the server
- rpc(Server, login, [self(), {node(), Name, Password}]),
+ rpc(Server, {login, {node(), Name, Password}}),
receive
%% the server returns the Pid of the process on the
%% client, that should handle the communication