anchor.diff:  connect(_, _) ->
       throw("invalid host or port to connect to").
   
  +recv_payload(Sock) ->
  +    inet:setopts(Sock, [{active,once}]),
  +    receive
  +        {tcp, Sock, <<Bulk/binary>>} ->
  +            {stream, Bulk};
  +        {tcp, _Sock, Data} ->
  +            io:format("invalid data received '~p' ~n", [Data]),
  +            {error, "invalid data received"};
  +        {tcp_closed, Sock} ->
  +            io:format("Socket ~w closed [~w]~n", [Sock ,self()]),
  +            {error, "Tcp socket was closed"};
  +        _ ->
  +            {error, "Generic error"}
  +    end.
  +
   recv_ok(Sock) ->
       inet:setopts(Sock, [{active,once}]),
       receive
           {tcp, Sock, <<"+OK", _/binary>>} ->
  -            % io:format("Hey received ok!~n"),
               ok;
  -        {tcp, Sock, Data} ->
  +        {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"};
           {tcp_closed, Sock} ->
  -            io:format("Socket ~w closed [~w]~n",[Sock ,self()]),
  +            io:format("Socket ~w closed [~w]~n", [Sock ,self()]),
               {error, "Tcp socket was closed"};
           _ ->
               {erorr, "Generic error"}
  
positive.code:     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}) ->
  
negative.code: handle_cast(Msg, State) ->
      io:format("Generic cast: '~p' while in '~p'~n",[Msg, State]),
      {noreply, State}.
  
  
  %% Generic
  handle_call(Msg, From, State) ->
  