anchor.diff:  handle_cast(_Msg, State) ->
       {noreply, State}.
   
  -%%--------------------------------------------------------------------
  -%% Function: handle_info(Info, State) -> {noreply, State} |
  -%%                                       {noreply, State, Timeout} |
  -%%                                       {stop, Reason, State}
  -%% Description: Handling all non call/cast messages
  -%%--------------------------------------------------------------------
   handle_info({'DOWN', _Ref, process, Pid, _Reason}, S) ->
       true = ets:match_delete(etorrent_recv_state, #rate_mgr { pid = {'_', Pid}, _='_'}),
       true = ets:match_delete(etorrent_send_state, #rate_mgr { pid = {'_', Pid}, _='_'}),
  
positive.code: 
  -define(SERVER, ?MODULE).
  
  %%====================================================================
  %% API
  %%====================================================================
  %%--------------------------------------------------------------------
  %% Function: start_link() -> {ok,Pid} | ignore | {error,Error}
  %% Description: Starts the server
  %%--------------------------------------------------------------------
  start_link() ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
  
  %% Send state information
  choke(Id, Pid) -> gen_server:cast(?SERVER, {choke, Id, Pid}).
  unchoke(Id, Pid) -> gen_server:cast(?SERVER, {unchoke, Id, Pid}).
  interested(Id, Pid) -> gen_server:cast(?SERVER, {interested, Id, Pid}).
  not_interested(Id, Pid) -> gen_server:cast(?SERVER, {not_interested, Id, Pid}).
  local_choke(Id, Pid) -> gen_server:cast(?SERVER, {local_choke, Id, Pid}).
  local_unchoke(Id, Pid) -> gen_server:cast(?SERVER, {local_unchoke, Id, Pid}).
  
  -spec get_state(integer(), pid()) -> {value, boolean(), #peer_state{}}.
  
negative.code: handle_info(_Info, State) ->
      {noreply, State}.
  
  terminate(_Reason, _S) ->
      ok.
  
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  %% --------------------------------------------------------------------
  sum_global_rate(Table) ->
      Objs = ets:match_object(Table, #rate_mgr { _ = '_' }),
      lists:sum([K#rate_mgr.rate || K <- Objs]).
  