anchor.diff:      timer:sleep(B*10),
       {noreply, reconnect(State#state{backoff=2*B})};
   
  -handle_info({http,{R,{error,socket_closed_remotely}}}, State=#state{request_id=R}) ->
  +handle_info({http, {_, stream_end, _Headers}}, State) ->
  +    %% stream_end of previous stream, we're reconnecting
  +    {noreply, State};
  +
  +handle_info({http,{R,{error,Reason}}}, State=#state{request_id=R, backoff=B}) ->
  +    lager:info("twitter: Error ~p, restarting~n", [Reason]),
  +    {noreply, reconnect(State#state{backoff=2*B})};
  +
  +
  +handle_info(reconnect, State) ->
       {noreply, reconnect(State)};
  -
   
   handle_info(Info, State) ->
       lager:info("twitter: Unhandled message: ~p~n", [Info]),
  
positive.code: %% Internal Function Definitions
  %% ------------------------------------------------------------------
  
  reconnect(State) ->
      lager:info("twitter: Reconnect."),
  
      {ok, Login} = application:get_env(geoheap, twitter_username),
      {ok, Password} = application:get_env(geoheap, twitter_password),
  
negative.code:                                     [],
                                      [{sync, false},
                                       {stream, self}]),
  
      erlang:send_after(7200*1000, self(), reconnect),
      State#state{request_id=RequestId}.
  