in reply to Re^4: Nonblocking commands in Windows
in thread Nonblocking commands in Windows
I'm not a cgi person, but there are various things that could be causing the symptoms you are describing. You need to determine where the delays are occuring.
If the java program produces a steady stream of output when invoked via the command line, it probably isn't the source of your problem.
You could confirm that it isn't your perl cgi script, by invoking it directly from the command line and watching what happens. If it also produces a steady stream when invoked this way, then there are a couple of other places where the problem could lie. Eg.
Some (maybe all?) browsers refuse to format tables until they know how many or how big the rows are.
You could probably verify if this is the problem, by temporarily switching the content type header to text/plain. That should cause the browser to display the html and content as it arrives rather than waiting until it knows how to format it.
If this is the problem, you may be able to avoid it by switching to using <p> or <br> formatting rather than (for example) a table.
A quick way of checking this would be to run the cgi script to completion, from the command line, having redirected stdout to a file. Then substitute a simple cgi script that slurps the file in one chunk, prints it to the browser in one chunk, and then sleeps for 5 minutes before exiting.
If you see that output in the browser straight away, then the delay is in the browser. If you don't see the output for 5 minutes, the delay is in the server/cgi interface.
If you supply a better picture of what you are doing--what server, browser, html formatting etc--you are using, then one of the many experienced CGI people here will be probably be able to offer you better ways of determining the source of your problem, and probably a solution to it.
Ultimately, unless your web server is dedicated to running just this task, or just a few low-demand tasks, it's generally not a good idea to have a cgi script that takes hours to run. The usual solutions to this involve forking, but they generally don't work under Win32 unless you are also using cygwin. I do have an alternative to that, but you would still need to fix the above problem(s) first.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Nonblocking commands in Windows
by technojosh (Priest) on Aug 06, 2007 at 14:37 UTC | |
by BrowserUk (Patriarch) on Aug 06, 2007 at 18:25 UTC |