anchor.diff:  -define(SEND_TIMEOUT_MSG, send_timeout).
   -define(SEND_TIMEOUT, timer:seconds(4)).
   -define(HIBERNATE_TIMEOUT, 5000).
  +-define(SHRINK_TIMEOUT, timer:minutes(5)).
  +-define(SHRINK_BUF_SIZE, 10).
  +-define(DEFAULT_BUF_SIZE, 1024).
   
   -include("logplex.hrl").
   -include("logplex_logging.hrl").
  
positive.code:         _EnoughTime ->
              do_reconnect(State)
      end;
  reconnect(State = #state{failures = F}) ->
      Max = logplex_app:config(tcp_syslog_backoff_max, 300),
      BackOff = case length(integer_to_list(Max, 2)) of
                    MaxExp when F > MaxExp -> Max;
                    _ -> 1 bsl F
                end,
      %% We hibernate only when we need to reconnect with a timer. The timer
      %% acts as a rate limiter! If you remove the timer, you must re-think
      %% the hibernation.
      {next_state, disconnected,
       reconnect_in(timer:seconds(BackOff), State), hibernate}.
  
  reconnect_in(MS, State = #state{}) ->
      Ref = erlang:start_timer(MS, self(), ?RECONNECT_MSG),
  
negative.code:                           {next_state, pstate(), #state{}}.
  do_reconnect(State = #state{sock = undefined,
                              reconnect_tref = undefined,
                              buf=Buf,
                              failures = Failures}) ->
      case connect(State) of
          {ok, Sock} ->
              ?INFO("drain_id=~p channel_id=~p dest=~s "
                    "state=disconnected at=connect try=~p sock=~p",
                    log_info(State, [Failures + 1, Sock])),
              NewBuf = case logplex_msg_buffer:len(Buf) =:= ?SHRINK_BUF_SIZE of
                          true -> logplex_msg_buffer:resize(?DEFAULT_BUF_SIZE, Buf);
                          false -> Buf
                      end,
              NewState = State#state{sock=Sock,
                                     reconnect_tref = undefined,
                                     send_tref = undefined,
                                     buf = NewBuf,
                                     connect_time=os:timestamp()},
              send(NewState);
          {error, Reason} ->
  