anchor.diff:  		not_valid ->
   		    {stop, invalid_pieces, S}
   	    end;
  -	_ ->
  +	N when is_integer(N) ->
   	    {stop, got_out_of_band_bitfield, S}
       end;
   handle_message({piece, Index, Offset, Data}, S) ->
  
positive.code: 	    S#state{piece_request = PR}
      end.
  
  enable_socket_messages(Socket) ->
      inet:setopts(Socket, [binary, {active, true}, {packet, 4}]).
  
  queue_up_requests(S, 0) ->
      {ok, S};
  queue_up_requests(S, N) ->
      case queue:out(S#state.request_queue) of
  	{empty, Q} ->
  	    select_piece_for_queueing(S#state{request_queue = Q});
  	{{value, {Index, Offset, Len}}, Q} ->
  	    torrent_peer_send:local_request(S#state.send_pid,
  					    Index, Offset, Len),
  
negative.code: 				      remote_request_set = RS}, N-1)
      end.
  
  %%--------------------------------------------------------------------
  %% Function: select_piece_for_queueing(state(), N) -> ...
  %% Description: Select a piece and chunk it up for queueing. Then make
  %%  a tail-call into queue_up_requests continuing the queue, or fail
  %%  if no piece is eligible.
  %%--------------------------------------------------------------------
  select_piece_for_queueing(S, _N) ->
      {ok, S}.
  
  