anchor.diff:      [decode_byte(B, SoFar) | decode_bytes(SoFar + 8, Rest)].
   
   
  +decode_allowed_fast(<<>>) -> [];
  +decode_allowed_fast(<<Index:32, Rest/binary>>) ->
  +    [Index | decode_allowed_fast(Rest)].
  +
  +encode_fastset([]) -> <<>>;
  +encode_fastset([Idx | Rest]) ->
  +    R = encode_fastset(Rest),
  +    <<R/binary, Idx:32>>.
  
positive.code: 	    {cancel, Index, Begin, Len} ->
  		<<?CANCEL, Index:32/big, Begin:32/big, Len:32/big>>;
  	    {port, PortNum} ->
  		<<?PORT, PortNum:16/big>>
          end,
      Sz = size(Datagram),
      Res = gen_tcp:send(Socket, <<Sz:32/big, Datagram/binary>>),
  
negative.code: %%--------------------------------------------------------------------
  recv_message(Rate, Message) ->
      MSize = size(Message),
      Decoded =
  	case Message of
  	    <<>> ->
  		keep_alive;
  	    <<?CHOKE>> ->
  		choke;
  	    <<?UNCHOKE>> ->
  		unchoke;
  	    <<?INTERESTED>> ->
  		interested;
  	    <<?NOT_INTERESTED>> ->
  		not_interested;
  	    <<?HAVE, PieceNum:32/big>> ->
  		{have, PieceNum};
  	    <<?BITFIELD, BitField/binary>> ->
  		{bitfield, BitField};
  	    <<?REQUEST, Index:32/big, Begin:32/big, Len:32/big>> ->
  		{request, Index, Begin, Len};
  	    <<?PIECE, Index:32/big, Begin:32/big, Data/binary>> ->
  		{piece, Index, Begin, Data};
  	    <<?CANCEL, Index:32/big, Begin:32/big, Len:32/big>> ->
  		{cancel, Index, Begin, Len};
  	    <<?PORT, Port:16/big>> ->
  		{port, Port};
  	    %% FAST EXTENSION MESSAGES
  	    <<?SUGGEST, Index:32/big>> ->
  		{suggest, Index};
  	    <<?HAVE_ALL>> ->
  		have_all;
  	    <<?HAVE_NONE>> ->
  		have_none;
  	    <<?REJECT_REQUEST, Index:32, Offset:32, Len:32>> ->
  		{reject_request, Index, Offset, Len};
  	    <<?ALLOWED_FAST, FastSet/binary>> ->
  		{allowed_fast, decode_allowed_fast(FastSet)}
  	end,
      {Decoded, etorrent_rate:update(Rate, MSize), MSize}.
  
  %%--------------------------------------------------------------------
  