anchor.diff:  -spec set_time_last_msg_sent(state()) -> state().
   set_time_last_msg_sent(State) -> setelement(14, State, os:timestamp()).
   
  +-spec time_last_msg_received(state()) -> erlang:timestamp().
  +time_last_msg_received(State) -> element(15, State).
  +-spec set_time_last_msg_received(state()) -> state().
  +set_time_last_msg_received(State) -> setelement(15, State, os:timestamp()).
  +
   -spec s_msg_count_session(state()) -> non_neg_integer().
  -s_msg_count_session(State)         -> element(15, State).
  +s_msg_count_session(State)         -> element(16, State).
   -spec inc_s_msg_count_session(state(), pos_integer()) -> state().
  -inc_s_msg_count_session(State, N)  -> setelement(15, State, s_msg_count_session(State) + N).
  +inc_s_msg_count_session(State, N)  -> setelement(16, State, s_msg_count_session(State) + N).
   
   -spec r_msg_count_session(state()) -> non_neg_integer().
  -r_msg_count_session(State)         -> element(16, State).
  +r_msg_count_session(State)         -> element(17, State).
   -spec inc_r_msg_count_session(state(), pos_integer()) -> state().
  -inc_r_msg_count_session(State, N)  -> setelement(16, State, r_msg_count_session(State) + N).
  +inc_r_msg_count_session(State, N)  -> setelement(17, State, r_msg_count_session(State) + N).
   
   -spec reset_msg_counters(state()) -> state().
  -reset_msg_counters(State) -> State1 = setelement(15, State, 0),
  -                             State2 = setelement(16, State1, 0),
  +reset_msg_counters(State) -> State1 = setelement(16, State, 0),
  +                             State2 = setelement(17, State1, 0),
                                inc_session_count(State2).
   
   -spec session_count(state()) -> state().
  -session_count(State) -> element(17, State).
  +session_count(State) -> element(18, State).
   -spec inc_session_count(state()) -> state().
  -inc_session_count(State) -> setelement(17, State, session_count(State) + 1).
  -
  --spec last_msg_sent(state()) -> comm:message().
  -last_msg_sent(State) -> element(18, State).
  --spec set_last_msg_sent(state(), comm:message()) -> state().
  -set_last_msg_sent(State, Msg) -> setelement(18, State, Msg).
  -
  --spec last_msg_received(state()) -> comm:message().
  -last_msg_received(State) -> element(19, State).
  --spec set_last_msg_received(state(), comm:message()) -> state().
  -set_last_msg_received(State, Msg) -> setelement(19, State, Msg).
  -
  --spec state_after_sending(state(), comm:message() | [{pid(), comm:message()}]) -> state().
  -state_after_sending(State, Msg) ->
  +inc_session_count(State) -> setelement(18, State, session_count(State) + 1).
  +
  +-spec last_msg_sent(state()) -> [comm:message()].
  +last_msg_sent(State) -> element(19, State).
  +-spec set_last_msg_sent(state(), [comm:message()]) -> state().
  +set_last_msg_sent(State, Msg) ->
  +    OldList = last_msg_sent(State),
  +    NumToKeep = erlang:max(?NUM_KEEP_MSGS - length(Msg), 0),
  +    NewList = Msg ++ lists:sublist(OldList, NumToKeep),
       State2 = set_time_last_msg_sent(State),
  -    case Msg of % bundle or plain message
  -        [{_, M}|_T] ->
  -            StateTemp = inc_s_msg_count(State2, length(Msg)),
  -            set_last_msg_sent(StateTemp, M);
  -        Msg ->
  -            StateTemp = inc_s_msg_count(State2),
  -            set_last_msg_sent(StateTemp, Msg)
  -    end.
  --spec state_after_receiving(state(), comm:message()) -> state().
  -state_after_receiving(State, Msg) ->
  -    State2 = set_last_msg_received(State, Msg),
  -    inc_r_msg_count(State2).
  +    State3 = inc_s_msg_count(State2, length(Msg)),
  +    setelement(19, State3, NewList).
  +
  +-spec last_msg_received(state()) -> [comm:message()].
  +last_msg_received(State) -> element(20, State).
  +-spec set_last_msg_received(state(), [comm:message()]) -> state().
  +set_last_msg_received(State, Msg) ->
  +    OldList = last_msg_received(State),
  +    NumToKeep = erlang:max(?NUM_KEEP_MSGS - length(Msg), 0),
  +    NewList = Msg ++ lists:sublist(OldList, NumToKeep),
  +    State2 = set_time_last_msg_received(State),
  +    State3 = inc_r_msg_count(State2, length(Msg)),
  +    setelement(20, State3, NewList).
  +
  +-spec save_n_msgs([msg_or_tag()], fun((state(), [msg_or_tag()]) -> state()), state()) -> state().
  +save_n_msgs(Msg, SaveFun, State) when is_tuple(Msg) ->
  +    save_n_msgs([{single, Msg}], SaveFun, State);
  +save_n_msgs(Msgs, SaveFun, State) when is_list(Msgs) ->
  +    NumElements = erlang:min(?NUM_KEEP_MSGS, length(Msgs)),
  +    List = [get_msg_tag(M) || M <- lists:sublist(Msgs, NumElements)],
  +    SaveFun(State, List).
  +
  +-spec get_msg_tag(msg_or_tag()) -> comm:msg_tag() | comm:message().
  +get_msg_tag(Msg) ->
  +    {_Pid, ActualMessage} = Msg,
  +    ?IIF(?KEEP_MSG_OR_TAG =:= tag,
  +         util:extint2atom(comm:get_msg_tag(ActualMessage)),
  +         setelement(1, ActualMessage, util:extint2atom(element(1, ActualMessage)))).
  +
  +-spec seconds_ago(time_last_msg(), time_last_msg()) -> non_neg_integer().
  +seconds_ago(Now, Time) ->
  +    case Time of
  +        {0,0,0} -> infinity;
  +        _ -> timer:now_diff(Now, Time) div 1000000
  +    end.
   
   -spec start_idle_check() -> ok.
   start_idle_check() ->
  
positive.code:                       OQueue::[comm:send_options()]}.
  -type stat_report() :: {RcvCnt::non_neg_integer(), RcvBytes::non_neg_integer(),
                          SendCnt::non_neg_integer(), SendBytes::non_neg_integer()}.
  -type time_last_msg_sent() :: erlang:timestamp().
  
  -type state() ::
      {DestIP                  :: inet:ip_address(),
  
negative.code: on({web_debug_info, Requestor}, State) ->
      Now = os:timestamp(),
      TimeLastMsgSent = time_last_msg_sent(State),
      TimeLastMsgReceived = time_last_msg_received(State),
      SecondsAgoSent = seconds_ago(Now, TimeLastMsgSent),
      SecondsAgoReceived = seconds_ago(Now, TimeLastMsgReceived),
      Runtime = timer:now_diff(Now, started(State)) / 1000000,
      {SentPerS, ReceivedPerS} =
          if Runtime =< 0 -> {"n/a", "n/a"};
  