anchor.diff:      handle_sock(sync(Sock), S);
   
   %% LOAD RDB DATA
  -handle_cast({load_rdb, Bulk}, S = #state{socket=_Sock, state=caca}) -> % FIXME
  +handle_cast({load_rdb, Bulk}, S = #state{socket=_Sock, state=lalala}) -> % FIXME
  +    rdb:save(Bulk, ?RDB_FILE),
  +    rdb:load(self(), ?RDB_FILE),
       io:format("load_rdb data -> ~p ~n", [Bulk]),
       {noreply, S};
   
  
positive.code:             {error, "Generic error"}
      end.
  
  recv_ok(Sock) ->
      inet:setopts(Sock, [{active,once}]),
      receive
          {tcp, Sock, <<"+OK", _/binary>>} ->
              ok;
          {tcp, _Sock, <<"-ERR Unrecognized REPLCONF", _/binary>>} ->
              {foo, bar}; % FIX ME
          {tcp, _Sock, Data} ->
              io:format("invalid data received '~p' ~n", [Data]),
              {error, "invalid data received"};
  
negative.code: %% Get type of synchronization
  handle_sock(ok, S = #state{socket=Sock, state=eof}) ->
      io:format("doing eof ~n"),
      case recv_repl(Sock) of
          {ok, Mode} ->
              Mode;
          {error, Error} -> % BUG in here!!
              {stop, socket_err, {S, Error}}
      end;
  %% Receive the payload from de synchronization command 'sync'
  handle_sock(ok, S = #state{socket=Sock, state=load, mode=sync}) -> % Remove 'mode=sync' ?
      io:format("getting payload sync ~n"),
      case recv_payload(Sock) of
          {stream, Bulk} ->
              gen_server:cast(self(), {load_rdb, Bulk}),
              {noreply, S#state{state=lalala}}; % Next state will be 'lalala' % FIXME
          {error, Error} ->
              {stop, socket_err, {S, Error}}
      end;
  
  %% Receive the payload from de synchronization command 'psync'
  handle_sock(ok, S = #state{socket=Sock, state=load, mode=psync}) -> % Remove 'mode=sync' ?
      io:format("getting payload psync ~n"),
      A = recv_payload(Sock),
      B = recv_payload(Sock),
      io:format("look -> ~p ~n", [A]),
      io:format("look -> ~p ~n", [B]),
      {noreply, S};
  
  handle_sock({error, Error}, S) ->
  