anchor.diff:      OldList = last_msg_sent(State),
       NumToKeep = erlang:max(?NUM_KEEP - length(Msg), 0),
       NewList = Msg ++ lists:sublist(OldList, NumToKeep),
  -    State2 = set_time_last_msg_sent(State),
  +    State2 = set_time_last_msg_seen(State),
       State3 = inc_s_msg_count(State2, length(Msg)),
       setelement(19, State3, NewList).
   
  
positive.code: 
  %% checks if the connection hasn't been used recently
  on({check_idle}, State) ->
      Timeout = config:read(tcp_idle_timeout),
      TimeLastMsgSent = time_last_msg_sent(State),
      start_idle_check(),
      case socket(State) =/= notconnected andalso
               timer:now_diff(os:timestamp(), TimeLastMsgSent) div 1000 > Timeout of
          true ->
              %% we timed out
              ?TRACE("Closing idle connection: ~p~n", [State]),
              close_connection(socket(State), State);
          _    ->
              ?TRACE("Connection not idle~n", []),
              State
      end;
  
  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),
  
negative.code: -spec set_last_stat_report(state(), stat_report()) -> state().
  set_last_stat_report(State, Val) -> setelement(13, State, Val).
  
  -spec time_last_msg_seen(state()) -> erlang:timestamp().
  time_last_msg_seen(State) -> element(14, State).
  -spec set_time_last_msg_seen(state()) -> state().
  set_time_last_msg_seen(State) -> setelement(14, State, os:timestamp()).
  
  -spec time_last_msg_received(state()) -> erlang:timestamp().
  time_last_msg_received(State) -> element(15, State).
  