anchor.diff:  handle_cast(shutdown, State) ->
       io:format("Generic cast: *shutdown* while in '~p'~n",[State]),
       {stop, normal, State};
  -%% generic
  +%% Generic
   handle_cast(Msg, State) ->
       io:format("Generic cast: '~p' while in '~p'~n",[Msg, State]),
       {noreply, State}.
   
  -
  +%% Generic
   handle_call(Msg, From, State) ->
       io:format("Generic call: '~p' from '~p' while in '~p'~n",[Msg, From, State]),
       {reply, ok, State}.
  -
   
   handle_info({loading, list, <<Key/binary>>, [FirstElem|_]}, State) ->
       io:format("key '~s' -> elem '~p' ~n", [Key, FirstElem]),
  
positive.code:     try initial() of
          {ok, Sock} ->
              gen_server:cast(self(), repl),
              {ok, #state{socket=Sock, state=init}};
          {error, timeout} ->
              io:format("timeout"),
              {stop, timeout};
  
negative.code: 
  % load_rdb(self()), % load rdb file
  
  %% REPLCONF listening-port.
  %% The initial step, send the repl with our
  %% client tcp port over the socket.
  handle_cast(repl, S = #state{socket=Sock, state=list}) ->
      io:format("repl ~n"),
      handle_sock(repl(Sock), S);
  
  %% REPLCONF capa eof.
  %% Check wheter the server is able to do partial
  %% synchronization or just can handle whole sync.
  handle_cast(capa, S = #state{socket=Sock, state=eof}) ->
      io:format("capa ~n"),
      Type = handle_sock(capa(Sock), S), % BUG: take care of recv errors.
      gen_server:cast(self(), Type),
      {noreply, S#state{state=load}};
  
  %% PSYNC.
  handle_cast(psync, S = #state{socket=_Sock, state=load}) ->
      io:format("psync ~n"),
      {noreply, S};
  
  %% SYNC.
  handle_cast(sync, S = #state{socket=_Sock, state=load}) ->
      io:format("sync ~n"),
      {noreply, S};
  