anchor.diff:  %% checks if the connection hasn't been used recently
   on({check_idle}, State) ->
       Timeout = config:read(tcp_idle_timeout),
  -    LastMsgSent = last_msg_sent(State),
  +    TimeLastMsgSent = time_last_msg_sent(State),
       case socket(State) =:= notconnected of
           true -> State;
           _    ->
  -            case timer:now_diff(os:timestamp(), LastMsgSent) div 1000 of
  +            case timer:now_diff(os:timestamp(), TimeLastMsgSent) div 1000 of
                   N when N > Timeout ->
                       %% we timed out
                       ?TRACE("Closing idle connection: ~p~n", [State]),
  
positive.code: -spec s_msg_count(state()) -> non_neg_integer().
  s_msg_count(State)             -> element(7, State).
  -spec inc_s_msg_count(state()) -> state().
  inc_s_msg_count(State)         -> State2 = setelement(7, State, s_msg_count(State) + 1),
                                    inc_s_msg_count_session(State2).
  
  -spec r_msg_count(state()) -> non_neg_integer().
  r_msg_count(State)             -> element(8, State).
  -spec inc_r_msg_count(state()) -> state().
  inc_r_msg_count(State)         -> State2 = setelement(8, State, r_msg_count(State) + 1),
                                    inc_r_msg_count_session(State2).
  
  -spec msg_queue(state()) -> msg_queue().
  msg_queue(State)               -> element(9, State).
  
negative.code:                    % -> to process this 1 msg + MQL messages (see below)
                     set_desired_bundle_size(T2, erlang:min(MQL, MaxBundle));
                 true ->
                     send(DestPid, Message, Options, State)
              end;
          QL ->
              {MsgQueue0, OptionQueue0} = msg_queue(State),
  