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: -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:           webhelpers:safe_html_string("~p", [RcvAgv])},
           {"recv total bytes",
            webhelpers:safe_html_string("~p", [RcvBytes])},
           {"time last message sent",
            webhelpers:safe_html_string("~p sec ago", [SecondsAgo])},
           {"last message sent:",
            webhelpers:html_pre("~50p", [last_msg_sent(State)])},
           {"last message received",
            webhelpers:html_pre("~50p", [last_msg_received(State)])},
           {"session variables:", ""},
           {"num sessions",
            webhelpers:safe_html_string("~p", [session_count(State)])},
  