-module(client).
-export([start/1, loop/1, register/2, login/2]).
start(Client) ->
process_flag(trap_exit, true),
spawn(client, loop, [Client]).
loop(Client) ->
receive
{list} ->
Client ! {ok, foo},
loop(Client);
true ->
Client ! {error, unknown_command},
loop(Client)
end.
register(Client, {Name, Password}) ->
dis ! {Client, {register, {Name, Password}}}.
login(Client, {Name, Password}) ->
dis ! {Client, {login, {Name, Password}}}.