anchor.diff:      inet:setopts(Sock, [{active,once}]),
       receive
           {tcp, Sock, <<"+FULLRESYNC", _, RunId:40/binary, _, Offset/binary>>} ->
  -            {fullresync, b2l(RunId), int_offset(Offset)}; % Fix my name
  +            {ok, fullresync, b2l(RunId), int_offset(Offset)};
           {tcp, _Sock, <<Bulk/binary>>} ->
  -            {load_stream, Bulk};
  +            {ok, load_stream, Bulk};
           {tcp, _Sock, Data} ->
               io:format("invalid data received '~p' ~n", [Data]),
               {error, "invalid data received"};
  
positive.code:     inet:setopts(Sock, [{active,once}]),
      receive
          {tcp, Sock, <<"+PONG", _/binary>>} ->
              {ok, Sock};
          {tcp, Sock, Data} ->
              io:format("invalid data received '~p' ~n", [Data]),
              {error, "invalid data received for pong"};
  
negative.code: 
  %% Convert -> <<"666\r\n">> to normal integer
  int_offset(B) when is_binary(B) ->
      B2 = hd(binary:split(B, ?CRLF)), % First element of binary
      binary_to_integer(B2);
  int_offset(_) ->
      throw("error in binary offset").
  