anchor.diff:          {error, Error} ->
               {stop, socket_err, {S, Error}}
       end;
  +%% Get type of synchronization
   handle_sock(ok, S = #state{socket=Sock, state=eof}) ->
  +    io:format("doing eof ~n"),
       case recv_ok(Sock) of
           ok ->
               psync;
  -        {error, "invalid data received"} -> %% Fix this for a better treatment
  +        {foo, bar} -> %% Fix this names
               sync;
           {error, Error} -> % BUG in here!!
               {stop, socket_err, {S, Error}}
       end;
  +%% Receive the payload from de synchronization command
  +handle_sock(ok, S = #state{socket=Sock, state=load, mode=sync}) -> % Remove 'mode=sync'
  +    io:format("getting payload ~n"),
  +    case recv_payload(Sock) of
  +        {stream, Bulk} ->
  +            gen_server:cast(self(), {load_rdb, Bulk}),
  +            {noreply, S#state{state=caca}}; % Next state will be 'caca' % FIXME
  +        {error, Error} ->
  +            {stop, socket_err, {S, Error}}
  +    end;
  +
   handle_sock({error, Error}, S) ->
       {stop, socket_err, {S, Error}};
   handle_sock(_,_) ->
  
positive.code: 
  -record(state, {runid="?",
                  offset=-1,
                  socket,
                  state,
                  monitor,
                  from}).
  
  
negative.code: load_rdb(Pid) when is_pid(Pid) ->
      rdb:load(Pid, ?RDB_FILE);
  load_rdb(_) ->
      {error, "invalid pid to load rdb"}.
  
  save_rdb(Data) when is_binary(Data) ->
      rdb:save(Data, ?RDB_FILE);
  save_rdb(_) ->
      {error, "invalid rdb data"}.
  
  send_pkg(Sock, Pkt) when is_list(Pkt) ->
      gen_tcp:send(Sock, [Pkt] ++ ?CRLF);
  