[ic] Trouble with Document->send()

Joachim Leidinger jojo@blackpoint.de
Fri, 04 May 2001 18:00:38 +0200


Mike Heins wrote:
> 
> Quoting Joachim Leidinger (jojo@blackpoint.de):
> > Hi list,
> >
> > i try
> >
> > [loop arg="1 2 3" send=1]
> > [perl]
> >      my $out = " ";
> >      $Document->hot(1);
> >      my $i = 0;
> >      for ($i = 1; $i <= 10; $i++)
> >      {
> >      $out .= " $i ";
> >      select(undef,undef,undef,1.000);
> >      }
> >      $out .= "<br> Next process <BR> ";
> >      $Document->send($out); # flush buffer
> > return '';
> > [/perl]
> > [/loop]
> >
> > and i want to display
> >
> > 1 2 3 4 5 6 7 8 9 10
> > Next process
> >
> > three times immediately every 10 seconds. But i get
> >
> > 1 2 3 4 5 6 7 8 9 10
> > Next process
> > 1 2 3 4 5 6 7 8 9 10
> > Next process
> > 1 2 3 4 5 6 7 8 9 10
> > Next process
> >
> > *after* 30 seconds.
> >
> > Why is
> >
> >  $Document->send();             # Send write buffer array to output,
> > done
> >                                 # automatically upon end of ASP, clears
> > buffer
> >                                 # and invalidates $Document->header()
> >  $Document->hot(1);             # Cause writes to send immediately
> >
> > not working?
> 
> Because there is a buffer that needs to fill up via the vlink/tlink
> program. One way to fill it is to send 1024 characters of whitespace at
> the end of what you want to send.
> 
> Also, your HTTP server may have ideas about what to do with output when
> it is not in NPH mode.

Thank you a lot! But 

[mvasp]
<%
my $out = " ";
my $filler = "";
    $i = 0;
     for ($i = 1; $i <= 1024; $i++)
     {
     $filler .= " ";
     }
$filler .= "<BR>";
$Document->hot(1);
$out = "a" . $filler;
$Document->send($out);
select(undef,undef,undef,1.000);
$out = "b" . $filler;
$Document->send($out);
select(undef,undef,undef,1.000);
$out = "c" . $filler;
$Document->send($out);
$out = "d" . $filler;
$Document->send($out);
select(undef,undef,undef,1.000);
$out = "e" . $filler;
$Document->send($out);
select(undef,undef,undef,1.000);
$out = "f" . $filler;
$Document->send($out);
%>
[/mvasp]

did not work! Changing

     for ($i = 1; $i <= 1024; $i++)
     {
     $filler .= " ";
     }

to

     for ($i = 1; $i <= 1700; $i++)
     {
     $filler .= " ";
     }

make the work!
What is the right max. number?

Once more...THANK YOU!!! :-))

Joachim


-- 
-------------<BPA FreeBsd>----------------------------------------------
Hans-Joachim Leidinger          black point arts Internet Solutions GmbH
email: jojo@blackpoint.de       FAX  : +49 0209-398265
http://www.bpaserver.net