getting realtime updates from CGI script 
Author Message
 getting realtime updates from CGI script

I have a Flash GUI that is attempting to display "realtime" updates from a
Perl CGI script.  The Perl script is passing a status variable back to Flash
indicating it's current state of progress.  The Flash app is receiving the
info, but only sees the last value of that variable.  I know the Perl script
is not buffering the data because I can run it from a command line (rather
than CGI) and see output like (text in <brackets> are my notes, not part of
the output):

status=1&<delay for a few seconds>status=2&<delay for a few
seconds>status=3&

The Flash app only displays status=3.  I suspect it's receiving the 3 values
all at once, each one overwriting the previous.  I'm not sure where to ask
about this since I don't know if it's a Perl thing, a Flash thing, an Apache
thing, an HTTP protocol thing, a CGI protocol thing, or what.
Roy



Sun, 16 May 2004 18:56:22 GMT  
 getting realtime updates from CGI script

Quote:

>I have a Flash GUI that is attempting to display "realtime" updates from a
>Perl CGI script.  The Perl script is passing a status variable back to Flash
>indicating it's current state of progress.  The Flash app is receiving the
>info, but only sees the last value of that variable.  I know the Perl script
>is not buffering the data because I can run it from a command line (rather
>than CGI) and see output like (text in <brackets> are my notes, not part of
>the output):

That proves that perl is not buffering the output when going to a terminal.
What happens when you pipe the output into 'cat'?  Did you set $| nonzero?

Quote:
>status=1&<delay for a few seconds>status=2&<delay for a few
>seconds>status=3&

Will the GUI allow you to modify the CGI to output "\n" instead of "&"?

Quote:
>The Flash app only displays status=3.  I suspect it's receiving the 3 values
>all at once, each one overwriting the previous.  I'm not sure where to ask
>about this since I don't know if it's a Perl thing, a Flash thing, an Apache
>thing, an HTTP protocol thing, a CGI protocol thing, or what.

You can test whether the http server is doing buffering by telnetting into
port 80 on the server, manually sending the GET request, and watch
the clustering of characters coming back.
        -Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


Mon, 17 May 2004 11:20:29 GMT  
 getting realtime updates from CGI script
Joe,
Thanks for you response.

Quote:
> What happens when you pipe the output into 'cat'?  Did you set $| nonzero?

It works the same (i.e. I see the delays) when I pipe it through cat as when
it goes straight to STDOUT.  Yes, I set $| to 1.  It would buffer even when
run from the shell before I set $|.

Quote:
> Will the GUI allow you to modify the CGI to output "\n" instead of "&"?

Not really.  Flash is expecting data in standard URL-encoded format, e.g.
var1=val1&var2=val2

Quote:
> You can test whether the http server is doing buffering by telnetting into
> port 80 on the server, manually sending the GET request, and watch
> the clustering of characters coming back.

I'm not sure if I can do that.  The server administrator (another
organization) has restricted telnet access and only allows SSH access.  Can
I do that through SSH (I'm using the PuTTY client)?  If so, how do I
manually send a GET request?

Roy



Mon, 17 May 2004 15:38:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. realtime cgi programs

2. CGI::Fast How to stop and update script?

3. cgi script no longer runs after server updated to perl 5.002

4. Getting IP address of client in CGI script

5. Getting ASP from cgi-bin Perl Script

6. Beginner: Getting a perl cgi script to run on Apache (WinNT)

7. Getting a perl CGI script to write to a file on another server

8. Stopping someone from getting my cgi-scripts

9. Getting Perl CGI Script To Get Me Back To Main Html Page

10. Perl CGI scripts getting slower...and...slower..

11. Getting command line arguments from cgi script (@ARGV)

12. getting the results from a remote cgi script to a text file

 

 
Powered by phpBB® Forum Software