1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-module(client). -export([start/1, loop/1]). start(Client) -> spawn(client, loop, Client). loop(Client) -> receive {list} -> Client ! {ok, media ! {all}}; true -> Client ! {error, unknown_command}, loop(Client) end.