anchor.diff:      end.
   
   now_to_msec({Mega,Sec,_}) -> (Mega*1000000 + Sec)*1000.
  +
  +default_buf_size() -> logplex_app:config(tcp_drain_buffer_size, 1024).
  
positive.code: -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").
  
negative.code:                   "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,
  