anchor.diff:  %%--------------------------------------------------------------------
   start_link(Port) ->
       gen_server:start_link(?MODULE, [Port], []).
  -loop() ->
  -    loop(self()).
   
  -loop(Pid) ->
  -    gen_server:cast(Pid, loop).
  +loop(N) ->
  +    loop(self(), N).
  +
  +loop(Pid, N) ->
  +    gen_server:cast(Pid, {loop, N}).
   %%%===================================================================
   %%% gen_server callbacks
   %%%===================================================================
  
positive.code:                  32768
           end,
      {ok, Sock} = gen_udp:open(Port, [binary, {active, false}, {recbuf, RB}]),
      loop(self()),
      {ok, #state{sock=Sock, port=Port}}.
  
  %%--------------------------------------------------------------------
  
negative.code: %%                                  {stop, Reason, State}
  %% @end
  %%--------------------------------------------------------------------
  handle_cast({loop, 0}, State) ->
      loop(?FAST_LOOP_CNT),
      {noreply, State};
  
  handle_cast({loop, N}, State = #state{sock=S}) ->
      case gen_udp:recv(S, 8192, 100) of
          {ok, {_Address, _Port, D}} ->
              handle_data(D),
              handle_cast({loop, N-1}, State);
          _ ->
              loop(?FAST_LOOP_CNT),
              {noreply, State}
      end;
  
  handle_cast(_Msg, State) ->
      {noreply, State}.
  