anchor.diff:                  port :: inet:port_number(),
                   sock = undefined :: 'undefined' | inet:socket(),
                   %% Buffer for messages while disconnected
  -                buf = logplex_msg_buffer:new() :: logplex_msg_buffer:buf(),
  +                buf = logplex_msg_buffer:new(?DEFAULT_BUF_SIZE) :: logplex_msg_buffer:buf(),
                   %% Last time we connected or successfully sent data
                   last_good_time :: 'undefined' | erlang:timestamp(),
                   %% TCP failures since last_good_time
  
positive.code:                           {next_state, pstate(), #state{}}.
  do_reconnect(State = #state{sock = undefined,
                              reconnect_tref = undefined,
                              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])),
              NewState = State#state{sock=Sock,
                                     reconnect_tref = undefined,
                                     send_tref = undefined,
                                     connect_time=os:timestamp()},
              send(NewState);
          {error, Reason} ->
  
negative.code:             logplex_app:config(tcp_drain_target_bytes,
                                 ?TARGET_SEND_SIZE)
      end.
  
  now_to_msec({Mega,Sec,_}) -> (Mega*1000000 + Sec)*1000.
  