Results 1 to 5 of 5

Thread: CGI Question : Can I launch a long process and return a page before it's finished?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    12

    CGI Question : Can I launch a long process and return a page before it's finished?

    The environment is NT server and I am using C++ to write the CGI program.


  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I'm gonna guess you could write all the data to the client, but it'll leave the connection open until both processed return (the launched one to your cgi app, then your app to IIS), causing the browser to keep showing the "loading" animation. Unfortunately I don't have good documentation on how IIS runs CGI.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    12
    I don't understand, can you elaborate more, plz?


    In fact, I don't need to display the result data on screen, I just want to show a page that inform the user his/her input has been submitted to the server.

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    A CGI app prints data to standard output. Whether that data is an HTML page or something else I'm not distinguishing.

    What I saying is that you could finish writing your HTML data to the user -- "</body></html>", and depending on buffering, that would go to the client and they'd see the web page, but since your CGI app is still running, the server's waiting for it to return or timeout, so the server's not going to close the connection to the client, so the client doesn't know that there's not more data coming its way, so its waits until the server closes the connection, or it decides to timeout.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    12
    ok

    but when the client timeouts, would it affect the CGI program that still running on the server side? I am asking because it seems that when the client timeouts, my CGI program on the server side dissappeared on the task manager (and I am sure it is not finish running yet).
    Is it possible to send any message to the client and pretend that the task is complete?

    thanks for replying

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width