anchor.diff:  readline(Port) ->
     receive
       {Port, {data, Data}} ->
  -      % io:format("readline = ~p~n", [Data]),
  +      io:format("port = ~p~n", [Data]),
         {data, Data};
       Msg ->
         error_logger:error_msg("unknown message ~p~n", [Msg]),
  
positive.code:   
  % Send a response to the client
  send_response_to_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path) ->
    % io:format("send response~n"),
    stream_out(Port, Sock, ResponsePipe),
    get_request_from_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path).
  
  % Read a request from a client
  get_request_from_client(RequestPipe, ResponsePipe, Port, Sock, Host, Path) ->
    % io:format("get request~n"),
    case gather_request(Sock, RequestPipe) of
      {ok, Request, RequestPipe2} ->
        % io:format("req = ~p~n", [Request]),
  
negative.code: stream_out(Port, Sock, Pipe) ->
    % io:format("stream out "),
    {ok, Data, P2} = read_chunk(Port, Pipe),
    io:format("~p~n", [Data]),
    gen_tcp:send(Sock, Data),
    case pipe:size(P2) =:= 0 andalso Data =:= <<"0000">> of
      true  -> done;
      false -> stream_out(Port, Sock, P2)
    end.
  