From c23e79de240b0c20d85f6a30188f96a4793c147f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20P=C3=A5lsson?= Date: Wed, 16 Feb 2011 17:05:22 +0100 Subject: [PATCH] Updated ggs_dispatcher with gen_server functionality --- src/ggs_dispatcher.erl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/ggs_dispatcher.erl b/src/ggs_dispatcher.erl index 8f89ceb..bc3327a 100644 --- a/src/ggs_dispatcher.erl +++ b/src/ggs_dispatcher.erl @@ -1,6 +1,13 @@ -module(ggs_dispatcher). + +%% API Exports -export([start_link/1, stop/1]). +%% gen_server callback exports +-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, + code_change/3]). + + %% @doc This module is the entry-point for clients connecting to GGS. This is %% the module responsible for: %% * Greeting a connecting client, and associating a socket for it @@ -19,3 +26,22 @@ start_link(Port) -> %% @spec stop(Reason) -> ok. %% Reason = String stop(Reason) -> not_implemented. + + +%% gen_server callbacks + +%% @doc Initiate the dispatcher. This is called from gen_server +init([Port]) -> + {ok, ok}. + +handle_call(_Message, _From, State) -> + {noreply, State}. + +handle_cast(_Message, State) -> + {noreply, State}. + +terminate(normal, _State) -> + ok. + +code_change(_OldVsn, State, Extra) -> + {ok, State}.