anchor.diff:           %% end PCB
            parent = self() :: pid(),              %% service process
            transport       :: pid() | undefined,  %% peer_fsm process
  -         tref :: reference(),     %% reference for current watchdog timer
  +         tref :: reference()      %% reference for current watchdog timer
  +               | integer()        %% monotonic time
  +               | tuple()          %% now()
  +               | undefined,
            dictionary :: module(),  %% common dictionary
            receive_data :: term(),
                    %% term passed into diameter_service with incoming message
  
positive.code: 
  %% Current watchdog has timed out.
  transition({timeout, TRef, tw}, #watchdog{tref = TRef} = S) ->
      set_watchdog(timeout(S));
  
  %% Timer was canceled after message was already sent.
  transition({timeout, _, tw}, #watchdog{}) ->
      ok;
  
  %% State query.
  transition({state, Pid}, #watchdog{status = S}) ->
  
negative.code: 
  %% set_watchdog/1
  
  %% Timer not yet set.
  set_watchdog(#watchdog{tref = undefined} = S) ->
      set_watchdog(0, S);
  
  %% Timer already set: start at new one only at expiry.
  set_watchdog(#watchdog{} = S) ->
      S#watchdog{tref = diameter_lib:now()};
  
  set_watchdog(stop = No) ->
      No.
  
  %% set_watchdog/2
  
  set_watchdog(Ms, #watchdog{tw = TwInit} = S) ->
      S#watchdog{tref = erlang:start_timer(tw(TwInit, Ms), self(), tw)}.
  
  %% A callback could return anything, so ensure the result isn't
  %% negative. Don't prevent abuse, even though the smallest valid
  %% timeout is 4000.
  tw(TwInit, Ms) ->
      max(tw(TwInit) - Ms, 0).
  
  tw(T)
    when is_integer(T), T >= 6000 ->
  