1. cgi "waiting..1..2.3" output...

Hi people,


Why the output of this CGI is not "one number per second" only the complete=
=20
result after 10 seconds?
Is there any way to make the output as it is on a display ?

The problem is that I have a slow cgi routine that stays running for 20 or=
=20
30 seconds and I want to output
the progress of the cgi for the user.


EUFORUM(http://www.rapideuphoria.com/listserv.htm), until the search is not=
=20
complete.

Searching ... 1996 ... 1997 ... 1998 ... 1999 ... 2000 ... 2001 ... 2002=
=20
... 2003 ... 2004 ...


Any suggestions ?


test.cgi

#! c:\euphoria\bin\exw.exe
include misc.e

for i=1 to 10 do
	puts(1,sprint(i)&"<br>")
	sleep (1)
end for



I=B4m using the Xitami server.


Thanks

Rubens

new topic     » topic index » view message » categorize

2. Re: cgi "waiting..1..2.3" output...

Rubens Monteiro Luciano wrote:
> 
> Hi people,
> 
> 
> Why the output of this CGI is not "one number per second" only the complete=
> =20
> result after 10 seconds?
> Is there any way to make the output as it is on a display ?
> 
> The problem is that I have a slow cgi routine that stays running for 20 or=
> =20
> 30 seconds and I want to output
> the progress of the cgi for the user.
> 
> 
> EUFORUM(<a
> href="http://www.rapideuphoria.com/listserv.htm">http://www.rapideuphoria.com/listserv.htm</a>),
> until the search is not=
> =20
> complete.
> 
> Searching ... 1996 ... 1997 ... 1998 ... 1999 ... 2000 ... 2001 ... 2002=
> =20
> ... 2003 ... 2004 ...
> 
> 
> Any suggestions ?
> 
> 
> test.cgi
> 
> #! c:\euphoria\bin\exw.exe
> include misc.e
> 
> for i=1 to 10 do
> 	puts(1,sprint(i)&"<br>")
> 	sleep (1)
> end for
> 
> 
Try this, maybe it will make a differance:
#! c:\euphoria\bin\exw.exe
include misc.e

for i=1 to 10 do
	puts(1,sprint(i)&"<br>")
        flush(1)
	sleep (1)
end for




> 
> I=B4m using the Xitami server.
> 
> 
> Thanks
> 
> Rubens
> 
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: cgi "waiting..1..2.3" output...

Rubens Monteiro Luciano wrote:
> 
> Hi people,
> 
> 
> Why the output of this CGI is not "one number per second" only the complete=
> =20
> result after 10 seconds?

Because the web page is sent by the cgi script once, when the program 
ends.

> Is there any way to make the output as it is on a display ?

Sort of.

> The problem is that I have a slow cgi routine that stays running for 20 or=
> =20
> 30 seconds and I want to output
> the progress of the cgi for the user.

You'll have to refresh the web page periodically. See here:
http://www.htmlgoodies.com/tutors/refresh.html

Irv

new topic     » goto parent     » topic index » view message » categorize

4. Re: cgi "waiting..1..2.3" output...

irv mullins wrote:
> 
> Rubens Monteiro Luciano wrote:

> > The problem is that I have a slow cgi routine that stays running for 20 or=
> > =20
> > 30 seconds and I want to output
> > the progress of the cgi for the user.
> 
> You'll have to refresh the web page periodically. See here:
> <a
> href="http://www.htmlgoodies.com/tutors/refresh.html">http://www.htmlgoodies.com/tutors/refresh.html</a>

That may not be a complete solution to your problem. See also:
http://wp.netscape.com/assist/net_sites/pushpull.html

Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: cgi "waiting..1..2.3" output...

irv mullins wrote:
> 
> irv mullins wrote:

> That may not be a complete solution to your problem. See also:
> <a
> href="http://wp.netscape.com/assist/net_sites/pushpull.html">http://wp.netscape.com/assist/net_sites/pushpull.html</a>

The *right way* to do this is with server push, but I'm not sure xitami 
will do server push. The other way is by having your program create and 
update a progress page, and setting the browser to refresh that page every 5 
or 10 seconds. Unfortunately, that means that if you have 2 or more people 
connected, you will have to work out some scheme to be sure each 
sees the progress page which is being updated by *their* copy of the 
cgi program. Push is easier, perhaps you will want to change server 
software.

Irv

new topic     » goto parent     » topic index » view message » categorize

6. Re: cgi "waiting..1..2.3" output...

Hi CoJaBo,

I try this:

#!\cgi-bin\euphoria\bin\exw.exe


include \biotecnologia\cgi-bin\euphoria\include\sort.e
include \biotecnologia\cgi-bin\euphoria\include\misc.e
include \biotecnologia\cgi-bin\euphoria\include\file.e


for i=1 to 5 do
puts(1,"1")
flush(1)
sleep(1)
end for

same result...

shows only 11111 after 5 seconds.


Rubens

new topic     » goto parent     » topic index » view message » categorize

7. Re: cgi "waiting..1..2.3" output...

Hi Irv,

         I try this. Didn=B4t work. Maybe the problem is Xitami.
         I look the code from the EUFORUM page and it didn=B4t seem to use=
=20
server-push...

#!\cgi-bin\euphoria\bin\exw.exe


include \cgi-bin\euphoria\include\sort.e
include \cgi-bin\euphoria\include\misc.e
include \cgi-bin\euphoria\include\file.e

puts(1,"HTTP/1.0 200")
puts(1,"Content-type:=20
multipart/x-mixed-replace;boundary=---ThisRandomString---")
puts(1,"")
puts(1,"---ThisRandomString---")

for i=1 to 5 do
         puts(1,"Content-type: text/html")
         puts(1,"")
         puts(1,"1")
         puts(1,"<p>")
         puts(1,"<plaintext>")
         puts(1,"---ThisRandomString---")
         sleep(1)
end for


At 21:55 6/9/2004, you wrote:
>============ The Euphoria Mailing List ====
=========
>
>
>posted by: irv mullins <irvm at ellijay.com>
>
>irv mullins wrote:
> >
> > irv mullins wrote:
>
> > That may not be a complete solution to your problem. See also:
> > <a=20
> href="http://wp.netscape.com/assist/net_sites/pushpull.html">http://wp.=
netscape.com/assist/net_sites/pushpull.html</a>
>
>The *right way* to do this is with server push, but I'm not sure xitami
>will do server push. The other way is by having your program create and
>update a progress page, and setting the browser to refresh that page every=
 5
>or 10 seconds. Unfortunately, that means that if you have 2 or more people=

>connected, you will have to work out some scheme to be sure each
>sees the progress page which is being updated by *their* copy of the
>cgi program. Push is easier, perhaps you will want to change server
>software.
>
>Irv
>
>--^----------------------------------------------------------------
>This email was sent to: rml at rubis.trix.net
>
>EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b4qFOM.cm1sQHJ1
>Or send an email to: EUforum-unsubscribe at topica.com
>
>For Topica's complete suite of email marketing solutions visit:
>http://www.topica.com/?p=TEXFOOTER
>--^----------------------------------------------------------------

new topic     » goto parent     » topic index » view message » categorize

8. Re: cgi "waiting..1..2.3" output...

Rubens Monteiro Luciano wrote:
> 
> Hi Irv,
> 
>          I try this. Didn=B4t work. Maybe the problem is Xitami.
>          I look the code from the EUFORUM page and it didn=B4t seem to use=
> =20
> server-push...
> 
> #!\cgi-bin\euphoria\bin\exw.exe
> 
> 
> include \cgi-bin\euphoria\include\sort.e
> include \cgi-bin\euphoria\include\misc.e
> include \cgi-bin\euphoria\include\file.e
> 
> puts(1,"HTTP/1.0 200")
> puts(1,"Content-type:=20

-- the next line IS server push! See the second web page ( recommended.

> multipart/x-mixed-replace;boundary=---ThisRandomString---")
> puts(1,"")
> puts(1,"---ThisRandomString---")
> 
> for i=1 to 5 do
>          puts(1,"Content-type: text/html")
>          puts(1,"")
>          puts(1,"1")
>          puts(1,"<p>")
>          puts(1,"<plaintext>")
>          puts(1,"---ThisRandomString---")
>          sleep(1)
> end for
> 
Irv

new topic     » goto parent     » topic index » view message » categorize

9. Re: cgi "waiting..1..2.3" output...

On 6 Sep 2004, at 22:18, Rubens Monteiro Luciano wrote:

> 
> 
> Hi CoJaBo,
> 
> I try this:
> 
> #!\cgi-bin\euphoria\bin\exw.exe
> 
> 
> include \biotecnologia\cgi-bin\euphoria\include\sort.e
> include \biotecnologia\cgi-bin\euphoria\include\misc.e
> include \biotecnologia\cgi-bin\euphoria\include\file.e
> 
> 
> for i=1 to 5 do
> puts(1,"1")
> flush(1)
> sleep(1)
> end for
> 
> same result...
> 
> shows only 11111 after 5 seconds.

The most obvious solution would be for the html to call for several src= files, 
and you delay sending them. Otherwise, send the first "1967" in a 1Kbyte 
packet, then "1968" in another 1K packet, etc. The server and recipent may 
have different MPU, so you for sure want the fullpackets sent out one sec 
apart, right? Or i could get royally flamed for saying anything.

Kat

new topic     » goto parent     » topic index » view message » categorize

10. Re: cgi "waiting..1..2.3" output...

irv mullins wrote:
> 
> Rubens Monteiro Luciano wrote:
> > 
> > Hi Irv,
> > 
> >          I try this. Didn=B4t work. Maybe the problem is Xitami.
> >          I look the code from the EUFORUM page and it didn=B4t seem to use=

As long as you're using Xitami, you're out of luck. I found this on 
their FAQ pages:

QUOTE:
Because Xitami does not work with streaming output, for now. 
It buffers all CGI output until the CGI ends, then sends it to the browser. 
We're considering alternatives to this model to allow streaming output.
/QUOTE

It looks like you will have to choose a better server, or wait until 
they add that feature. There _might_ be a workaround, but the complexity 
of such boggles the mind. Much easier to change server software.

Irv

new topic     » goto parent     » topic index » view message » categorize

11. Re: cgi "waiting..1..2.3" output...

Ok Irv, thanks.

I search the faq yesterday for the term "server push" and found nothing.
Good that you found this.
I will consider moving to another server.

Thanks Kat and CoLABo too.

Rubens


At 09:35 7/9/2004, you wrote:
>
>
>posted by: irv mullins <irvm at ellijay.com>
>
>irv mullins wrote:
> >
> > Rubens Monteiro Luciano wrote:
> > >
> > > Hi Irv,
> > >
> > >          I try this. Didn=B4t work. Maybe the problem is Xitami.
> > >          I look the code from the EUFORUM page and it didn=B4t seem 
> to use=
>
>As long as you're using Xitami, you're out of luck. I found this on
>their FAQ pages:
>
>QUOTE:
>Because Xitami does not work with streaming output, for now.
>It buffers all CGI output until the CGI ends, then sends it to the browser.
>We're considering alternatives to this model to allow streaming output.
>/QUOTE
>
>It looks like you will have to choose a better server, or wait until
>they add that feature. There _might_ be a workaround, but the complexity
>of such boggles the mind. Much easier to change server software.
>
>Irv
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu