aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
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