[ic] Trouble with Document->send()

Dan B db@cyclonehq.dnsalias.net
Fri, 04 May 2001 08:39:06 -0700


At 11:29 AM 5/4/2001 -0400, you 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.

Does mod_interchange behave any differently in that respect?  (E.g. does it 
automatically flush buffers without 1024 chars filled first?)

Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com