anchor.diff:                  %% Last time we connected or successfully sent data
                   last_good_time :: 'undefined' | erlang:timestamp(),
                   %% TCP failures since last_good_time
  -                failures = 0 :: non_neg_integer(),
  -                %% Reconnect timer reference
  -                tref = undefined :: 'undefined' | reference()
  +                failures = 0 :: non_neg_integer()
                  }).
   
   -define(RECONNECT_MSG, reconnect).
  
positive.code:         {error, _} = E -> E
      end.
  
  -spec reconnect('idle' | 'udp_error', #state{}) -> #state{}.
  %% @private
  reconnect(_Reason, State = #state{failures = F}) ->
      BackOff = erlang:min(logplex_app:config(tcp_syslog_backoff_max),
                           1 bsl F),
      Ref = erlang:send_after(timer:seconds(BackOff), self(), ?RECONNECT_MSG),
      State#state{tref=Ref}.
  
  %% @private
  udp_good(State = #state{}) ->
      State#state{last_good_time = os:timestamp(),
  
negative.code:   when is_tuple(Msg) ->
      case connect(State) of
          {ok, Addr, Sock} ->
              ?INFO("drain_id=~p channel_id=~p dest=~s at=connect try=~p addr=~s",
                    log_info(State, [State#state.failures + 1,
                                     host_str(Addr)])),
              handle_info({post, Msg},
                          udp_good(State#state{address=Addr, sock=Sock}));
          {error, Reason} ->
              NewState = udp_bad(State#state{sock=undefined}),
              msg_stat(drain_dropped, 1, NewState),
              ?ERR("drain_id=~p channel_id=~p dest=~s at=connect "
                   "err=gen_udp data=~p try=~p last_success=~s",
                   log_info(State, [Reason, NewState#state.failures,
                                    time_failed(NewState)])),
              {noreply, NewState}
      end;
  
  handle_info({post, Msg}, State = #state{}) when is_tuple(Msg) ->
  