Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IStopListeningRegisteredObject Interface

[Supported in the .NET Framework 4.5.1 and later versions]

Listens for GL_STOP_LISTENING notifications from IIS.

Namespace:  System.Web.Hosting
Assembly:  System.Web (in System.Web.dll)

public interface IStopListeningRegisteredObject : IRegisteredObject

The IStopListeningRegisteredObject type exposes the following members.

  NameDescription
Public methodStopRequests a registered object to unregister. (Inherited from IRegisteredObject.)
Public methodStopListening[Supported in the .NET Framework 4.5.1 and later versions] Stops listening for new requests.
Top

You can implement the IStopListeningRegisteredObject interface by passing an object to the RegisterObject method. The passed object listens for GL_STOP_LISTENING notifications from IIS. You can call this implementation when ASP.NET receives a GL_STOP_LISTENING notification from IIS, which signals that IIS is no longer listening for new requests for this application. The web server can allow requests that are in progress to run to completion. If your application processes long running requests, you might want to have the application listen for these IIS notifications to gracefully wind down the request. The StopListening method contrasts with the Stop method, which signals immediate application shutdown.

.NET Framework

Supported in: 4.6, 4.5.1
Show:
© 2015 Microsoft