anchor.diff:  
   set_keepalive_timer(0) -> ok;
   set_keepalive_timer(KeepAlive) ->
  -    _ = send_after(KeepAlive, check_keepalive),
  +    %% This allows us to heavily reduce start and cancel timers,
  +    %% however we're losing precision. But that's ok for the keepalive timer.
  +    _ = send_after(KeepAlive * 750, check_keepalive),
       ok.
   
   -spec send_after(non_neg_integer(), any()) -> reference().
  
positive.code:    end.
  
  %%% init  --> | wait_for_connect | --> | connected | --> terminate
  in(Msg, {connected, State}) ->
      case connected(Msg, State) of
          {stop, _, _} = R -> R;
          {NewState, Out} ->
              {{connected, set_last_time_active(NewState)}, Out}
      end;
  in(Msg, {wait_for_connect, State}) ->
      case wait_for_connect(Msg, State) of
          {stop, _, _} = R -> R;
          {NewState, Out} ->
              %% state transition to | connected |
              {{connected, set_last_time_active(NewState)}, Out}
      end.
  
  
  
negative.code:     terminate(normal, State);
  connected(check_keepalive, #state{last_time_active=Last, keep_alive=KeepAlive} = State) ->
      Now = os:timestamp(),
      case (timer:now_diff(Now, Last) div 1000000) > KeepAlive of
          true ->
              lager:warning("[~p] stop due to keepalive expired", [self()]),
              terminate(normal, State);
          false ->
              set_keepalive_timer(KeepAlive),
  