anchor.diff:  % This is sent back immediately to the client.
   send_index_to_client(Port, Sock, Host, Path) ->
     Index = gather_out(Port),
  +  io:format("index = ~p~n", [Index]),
     gen_tcp:send(Sock, Index),
     get_demand_from_client(Port, Sock, Host, Path).
     
  
positive.code:       gather_out(Port, TotalData, P2)
    end.
    
  stream_out(Port, Sock) ->
    stream_out(Port, Sock, pipe:new()).
    
  stream_out(Port, Sock, Pipe) ->
    % io:format("stream out "),
    % io:format("+++~n~p~n+++~n", [Data]),
    {ok, Data, P2} = read_chunk(Port, Pipe),
    gen_tcp:send(Sock, Data),
    case Data =:= <<"0000">> of
      true  -> done;
      false -> stream_out(Port, Sock, P2)
    end.
    
  read_chunk(Port, Pipe) ->
    case pipe:size(Pipe) >= 4 of
      true ->
  
negative.code:   end.
  
  gather_demand(Sock) ->
    gather_demand(Sock, [], pipe:new()).
  gather_demand(Sock, DataSoFar, Pipe) ->
    {ok, Data, P2} = read_chunk_from_socket(Sock, Pipe),
    % io:format("+++~n~p~n+++~n", [Data]),
    TotalData = lists:append(DataSoFar, [Data]),
    case Data =:= <<"0000">> of
      true ->
        {ok, binary_to_list(list_to_binary(TotalData))};
      false ->
        gather_demand(Sock, TotalData, P2)
    end.
  
  gather_out(Port) ->
  