All pastes #27627 Raw Edit

Something

public text v1 · immutable
#27627 ·published 2005-11-04 19:14 UTC
rendered paste body
    S := DateTimeToUnix(Now);
    LL := 0;
    while (Sock.Socket.Connected = TRUE) do
    begin
      if (DateTimeToUnix(Now)-S >= intTimeout) then
      begin
        result.Data := '';
        result.Headers := '';
        result.Code := 0;
        result.CodeStr := 'Data transmission timed out';
        exit;
      end;
      result.Data := result.Data+Sock.Socket.ReceiveText;
      if (Length(result.Data) > LL) then
      begin
        LL := Length(result.Data);
        S := DateTimeToUnix(Now);
      end;
      Application.ProcessMessages;
      sleep(1);
    end;