anchor.diff:          ok ->
               ?TRACE("~.0p Sent message ~.0p~n",
                      [pid_groups:my_pidname(), Message]),
  -            StateNew = set_last_msg_sent(State),
  +            State2 = state_after_sending(State, Message),
               %% only close in case of no_keep_alive if the
               %% connection was solely initiated for this send
               case lists:member({no_keep_alive}, Options)
  -                     andalso s_msg_count_session(StateNew) =< 1 of
  -                true -> close_connection(Socket, StateNew);
  -                _    -> StateNew
  +                     andalso s_msg_count_session(State2) =< 1 of
  +                true -> close_connection(Socket, State2);
  +                _    -> State2
               end;
           {error, closed} ->
               Address = dest_ip(State),
  
positive.code: 
  on({web_debug_info, Requestor}, State) ->
      Now = os:timestamp(),
      LastMsgSent = last_msg_sent(State),
      SecondsAgo =
          case LastMsgSent of
              {0,0,0} -> infinity;
              _ ->  timer:now_diff(Now, last_msg_sent(State)) div 1000000
          end,
      Runtime = timer:now_diff(Now, started(State)) / 1000000,
      {SentPerS, ReceivedPerS} =
  
negative.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) -> inc_s_msg_count(State, 1).
  -spec inc_s_msg_count(state(), pos_integer()) -> state().
  inc_s_msg_count(State, N)      -> State2 = setelement(7, State, s_msg_count(State) + N),
                                    inc_s_msg_count_session(State2, N).
  
  -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)         -> inc_r_msg_count(State, 1).
  -spec inc_r_msg_count(state(), pos_integer()) -> state().
  inc_r_msg_count(State, N)      -> State2 = setelement(8, State, r_msg_count(State) + N),
                                    inc_r_msg_count_session(State2, N).
  
  -spec msg_queue(state()) -> msg_queue().
  msg_queue(State)               -> element(9, State).
  