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:     _:_ -> ok
    end.
  
  gather_request(Sock, Pipe) ->
    gather_request(Sock, [], Pipe).
  gather_request(Sock, DataSoFar, Pipe) ->
    try
      {ok, Data, P2} = read_chunk_from_socket(Sock, Pipe),
      % io:format("~p~n", [Data]),
      TotalData = lists:append(DataSoFar, [Data]),
      case Data =:= <<"0000">> orelse Data =:= <<"0009done\n">> of
        true ->
          {ok, binary_to_list(list_to_binary(TotalData)), P2};
        false ->
  
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.
  