Erlang gen_server

-module(tcp_server).

-behaviour(gen_server).

-export([start_link/0, init/1, handle_call/3, handle_cast/2]).

start_link() -> 
    gen_server:start_link(?MODULE, ok, []).

init(ok) ->
    io:format("tcp_server init...\n"),
    {ok, []}.

handle_call(Command, _From, State) ->
    case Command of 
        {add, List} ->
            {reply, List, [List | State]};
        {get} -> 
            {reply, State, State} 
    end.

handle_cast(get, State) -> 
    {noreply, State}.