anchor.diff:          {ok, Sock} ->
               ?INFO("drain_id=~p channel_id=~p dest=~s at=connect try=~p sock=~p",
                     log_info(State, [State#state.failures + 1, Sock])),
  -            NewState = tcp_good(State#state{sock=Sock}),
  +            NewState = tcp_good(State#state{sock=Sock,
  +                                            connect_time=os:timestamp()}),
               {noreply, post_buffer(NewState)};
           {error, Reason} ->
               NewState = tcp_bad(State),
  
positive.code:                             post_buffer(tcp_good(State#state{buf=NewBuf}));
                          {error, Reason} ->
                              ?ERR("drain_id=~p channel_id=~p dest=~s at=post "
                                   "err=gen_tcp data=~p",
                                   log_info(State, [Reason])),
                              reconnect(tcp_error,
                                        tcp_bad(State))
                      end
  
negative.code:                     %% Don't use NewBuf - we want to keep the old
                      %% buffer state so we don't drop the msg.
                      ?ERR("drain_id=~p channel_id=~p dest=~s at=post "
                           "err=gen_tcp data=~p duration=~p",
                           log_info(State, [Reason, duration(State)])),
                      reconnect(tcp_error, tcp_bad(State))
              end
      end.
  