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: %% Handle the receiving data in socket depending
  %% in which state is.
  handle_sock(ok, S = #state{socket=Sock, state=list}) ->
      case recv_ok(Sock) of
          ok ->
              gen_server:cast(self(), capa),
  
negative.code:     {noreply, S};
  
  %% SYNC.
  handle_cast(sync, S = #state{socket=Sock, state=load}) ->
      io:format("sync ~n"),
      handle_sock(sync(Sock), S);
  
  %% LOAD RDB DATA
  handle_cast({load_rdb, Bulk}, S = #state{socket=_Sock, state=caca}) -> % FIXME
      io:format("load_rdb data -> ~p ~n", [Bulk]),
      {noreply, S};
  
  handle_cast(shutdown, State) ->
  