473,659 Members | 2,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

detect when an app domain is being shut down

Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.Curre ntDomain.Domain Unload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 11 '06 #1
5 4376
Hi,
I think this can be handled inside AppDomain.Unhan dledException event.
If you want complete working code for it then please let me know.

Thanks and Regards,
mansih bafna

"Bubba" wrote:
Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.Curre ntDomain.Domain Unload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 12 '06 #2
Hi,
Have you also tried AppDomain.Proce ssExit?

Thanks and Regards,
manish bafna

"Bubba" wrote:
Hi,

We have HttpHandlers that can process requests for up to 50 minutes. Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example). I
looked at the Application_End method in global.asax, as well as the System.
AppDomain.Curre ntDomain.Domain Unload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba
Dec 12 '06 #3
Hi Manish,

Thanks for your input, but AppDomain.Proce ssExit is not called while there
are requests running. Also, AppDomain.UnHan dledException is not appropriate
because there are no exceptions thrown in this case.

Thanks,
Bubba
Dec 12 '06 #4
Since your http handlers are still executing you AppDomain will not shut
down so could you hook into any shutdown event?

Gabriel

"Bubba" <fa**@fake.fake wrote in message
news:f9******** *************** *******@ureader .com...
Hi,

We have HttpHandlers that can process requests for up to 50 minutes.
Those
HttpHandlers are running in an app domain inside the DefaultAppPool. We'd
like the HttpHandlers to be able to detect when its containing app pool or
app domain is requesting a shutdown (when it is recycling, for example).
I
looked at the Application_End method in global.asax, as well as the
System.
AppDomain.Curre ntDomain.Domain Unload event. Neither get called as long as
the HttpHandlers are handling a client request. Is there a way to
programatically know when an app domain is about to shut down? We need to
know so that we can force the request to end more quickly and gracefully.

Thanks for you help.

Bubba

Dec 12 '06 #5
In essence, that is what I want to do - but I don't know where to do that.

Bubba
Dec 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5843
by: Claire | last post by:
Running XP pro, SP2. Visual studio .NET 2003. App written in C# I have written an application that hides itself when run and shows a notification icon in the system tray. If the main form is visible/restored to the desktop, and I tell windows to restart, windows shuts down fine. If the main form is minimized to the tray and I tell windows to restart, other desktop apps close down fine but my program's icon remains sat in the system...
2
19930
by: Mike Stephens | last post by:
I have an application to minimizes when X is clicked. If the user wants to close the application they click the Exit Application button.This works fine and does exactly what I need. I have since discovered it is holding Windows open when you shutdown. If the application is running and the user shutsdown Window it holds up everything. If the application is not running and the user shutsdown Windows is shutsdown in a timely manner. How...
3
1583
by: BrianDH | last post by:
Hi I have a VB.Net windows application that for some reason when running will not allow the user to shut-down/reboot the Operating System without first closing my application. Has anyone had the problem and how might I resolve it? I need my app to allow the user to shut-down and or reboot their OS without closing my application first. Thanks
4
3686
by: pamelafluente | last post by:
Hi Guys, I have a small application which uses a NotifyIcon. The user can set a flag (PreventClosing ) so that when he clicks on the form-cancel button "X", the program will instead be minimized in the icon try. See code attached. My problem is that my code is probably too naive. In fact there is a problem when one tries to shut dow or restart Windows. Windows does NOT want to shut down! I guess it's the e.cancel = TRUE statement in...
2
11756
by: Jason S | last post by:
Hi there, I created a simple VB app that runs in the background that I now need to detect when Windows (XP with SP2) is just about to Shut Down OR the user is Logging Off. Is this possible? I require my app to either pause the shutdown/log-off process for a few seconds whilst it does something important (it's a security thing). As soon as its finished, Windows should resume logging off the user and/or shutting down. Thanks in advance.
7
1960
by: mangesh | last post by:
Is there any function in standard library that can forcefully release memory associated with a process(application) ? Regards Mangesh .
0
1090
by: Sidney | last post by:
Dear, I am writting a system which opened at the system tray. But every before I shut down my computer, I have to close the system first. However, it should be automatically close when I shutting down my system. So, I want to know how I can do so that it can close up itself when the computer shut down. Thank You!! Sidney
8
1952
by: Austen | last post by:
Hello i trying to shut down window using vb. i able to restart and log off, but was unable to shut down. when excute the shut down command , nothing happend. it related to window os security issue?
1
1562
by: shubby | last post by:
hello, I have a same kind of problem, when i shut-down my system, it gets restarted, plz assist me how to correct that Thanks
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.