diff --git a/src/ggs_coordinator.erl b/src/ggs_coordinator.erl index 2a755f0..817b7a7 100644 --- a/src/ggs_coordinator.erl +++ b/src/ggs_coordinator.erl @@ -42,7 +42,11 @@ respawn_table(_Token) -> %% @doc Removes a player from coordinator. remove_player(_From, _Player) -> +<<<<<<< HEAD helpers:not_implemented(). +======= + not_implemented. +>>>>>>> jonte_rewrite %% gen_server callbacks diff --git a/src/ggs_dispatcher.erl b/src/ggs_dispatcher.erl index 4e353da..652a229 100644 --- a/src/ggs_dispatcher.erl +++ b/src/ggs_dispatcher.erl @@ -31,6 +31,7 @@ start_link(Port) -> %% Reason = String stop(_Reason) -> helpers:not_implemented(). + %% gen_server callbacks %% @doc Initiate the dispatcher. This is called from gen_server diff --git a/src/ggs_player.erl b/src/ggs_player.erl index d321ea4..79d0d06 100644 --- a/src/ggs_player.erl +++ b/src/ggs_player.erl @@ -30,13 +30,17 @@ get_token(_Player) -> %% @doc Properly terminates the player process. The player token will be destroyed. %% Makes table token unreferenced and destroys the process in the end. %% @spec stop(Table::pid()) -> Reason::string() -stop(Table) -> +stop(_Table) -> helpers:not_implemented(). - %% Internals loop(Socket) -> + % The socket is in 'active' mode, and that means we are pushed any data + % that arrives on it, we do not need to recv() manually. Since the socket + % was opened in our parent process, we need to change the owner of it to + % us, otherwise these messages end up in our parent. + erlang:port_connect(Socket, self()), receive {tcp, Socket, Data} -> % Just echo for now.. gen_tcp:send(Socket,Data), loop(Socket)