Forum Moderators: phranque

Message Too Old, No Replies

App runs forever

         

shivakarsh

7:58 am on Dec 13, 2004 (gmt 0)

10+ Year Member



I've installed a CGI App. Hello.exe and gave scriptalias param to the directory that has this particular file. But then what happens is suppose I've a partial request like if I request for this file hello.exe and then press stop immediately in the IE toolbar, the process hello.exe is there in the taskmanager even though I cancel ther request. How do i solve the problem of terminating the process on cancellation of the request?

sublime1

1:07 am on Dec 19, 2004 (gmt 0)

10+ Year Member



It shouldn't run forever, in fact, it's probably not actually "running", instead it's probably waiting on for the other guy to answer.

When the remote (client) socket connection is terminated the server doesn't really know, so has to assume that the client is just getting around to being ready to accept the response. It will wait in this state for the length of time specified by the SO_LINGER value specified in the application or operating system, which I think is an overly generous 600 seconds by default. So if you wait 5 minutes, I bet the child httpd will go away.

I'm not exactly sure where or how, but I think you can specify the value for SO_LINGER using set_sockopt.

But maybe you just don't need to worry about it -- if your page is fast enough, few users will have time to cancel and the few spare httpd children sitting around waiting are doing no harm and will go away after a while.