diff options
author | Jakob Pfender <jpfender@zedat.fu-berlin.de> | 2010-10-14 10:30:29 +0200 |
---|---|---|
committer | Jakob Pfender <jpfender@zedat.fu-berlin.de> | 2010-10-14 10:30:29 +0200 |
commit | a31253b510636f48c7a50a54106dcb248028cf34 (patch) | |
tree | 783c8741bd3ff260acdd53671001d9fc2288768b /server/client.erl | |
parent | 37a33b4ef3a8d9c4a1b984e44bfe5be03525c302 (diff) | |
parent | aa16b66ce4c64dd165292f5fb931d57f09d436d6 (diff) | |
download | erlang-a31253b510636f48c7a50a54106dcb248028cf34.tar.gz erlang-a31253b510636f48c7a50a54106dcb248028cf34.tar.xz erlang-a31253b510636f48c7a50a54106dcb248028cf34.zip |
Merge branch 'master' of ssh://git.animux.de/erlang
Diffstat (limited to '')
-rw-r--r-- | server/client.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/client.erl b/server/client.erl index 61260b4..bf8bc22 100644 --- a/server/client.erl +++ b/server/client.erl @@ -3,13 +3,13 @@ start(Node) -> process_flag(trap_exit, true), - {Client, Ref} = server:start_on_node(Node, client, undef), + Client = server:start_on_node(Node, client, undef), link(Client), - Server = spawn_link(client, loop, [{Client, Ref}]), + Server = spawn_link(client, loop, [Client]), - case server:rpc({Client, Ref}, {change_state, Server}) of + case server:rpc(Client, {change_state, Server}) of {ok} -> - {ok, {Client, Ref}}; + {ok, Client}; _ -> {error, unknown_error} end. @@ -17,11 +17,11 @@ start(Node) -> loop(Client) -> receive list -> - server:send(Client, {ok, {foo}}), + Client ! {ok, {foo}}, loop(Client); Cmd -> - server:send(Client, {error, {unknown_command, Cmd}}), + Client ! {error, {unknown_command, Cmd}}, loop(Client) end. |