anchor.diff:      %% Stale message.
       send(State);
   ready_to_send({timeout, _Ref, ?IDLE_TIMEOUT_MSG}, S) ->
  -    close_if_idle(S);
  +    close_if_idle(S, disconnected, ready_to_send);
   ready_to_send({post, Msg}, State = #state{sock = Sock})
     when is_port(Sock) ->
       send(buffer(Msg, State));
  
positive.code:             ?INFO("drain_id=~p channel_id=~p dest=~s at=idle_timeout",
                    log_info(State, [])),
              gen_tcp:close(Sock),
              {next_state, disconnecting, State#state{sock=undefined}, hibernate};
          _ ->
              {next_state, sending, start_idle_timer(State)}
      end.
  
  buffer_to_pkts(Buf, BytesRemaining, DrainTok) ->
  
negative.code:           log_info(S, [sending, Reason, Sock, duration(S)])),
      reconnect(tcp_bad(S));
  sending({timeout, _, ?IDLE_TIMEOUT_MSG}, State) ->
      close_if_idle(State, disconnecting, sending);
  sending(timeout, S = #state{}) ->
      %% Sleep when inactive, trigger fullsweep GC & Compact
      {next_state, sending, S, hibernate};
  