IStopListeningRegisteredObject 介面

定義

GL_STOP_LISTENING 聽來自 IIS 的通知。

public interface class IStopListeningRegisteredObject : System::Web::Hosting::IRegisteredObject
public interface IStopListeningRegisteredObject : System.Web.Hosting.IRegisteredObject
type IStopListeningRegisteredObject = interface
    interface IRegisteredObject
Public Interface IStopListeningRegisteredObject
Implements IRegisteredObject
實作

備註

你可以透過將物件傳給方法來IStopListeningRegisteredObject實作介面RegisterObject。 傳遞的物件會監聽 GL_STOP_LISTENING 來自 IIS 的通知。 當 ASP.NET 收到來自 IIS 的 GL_STOP_LISTENING 通知時,你可以呼叫此實作,該通知表示 IIS 不再監聽該應用程式的新請求。 網頁伺服器可以允許正在進行的請求執行到最後。 如果你的應用程式處理的是長時間執行的請求,你可能想讓應用程式監聽這些 IIS 通知,以便能順利結束請求。 此 StopListening 方法與 Stop 立即關閉應用程式的方法形成對比。

方法

名稱 Description
Stop(Boolean)

請求已註冊物件取消註冊。

(繼承來源 IRegisteredObject)
StopListening()

停止聆聽新的請求。

適用於

執行緒安全性

此類實例成員不保證執行緒安全。 該 StopListening() 方法可隨時呼叫,包括在同一物件上呼叫其他方法(例如 Stop(Boolean))時,或是呼叫其他物件 StopListening() 的方法執行時。 由於這些方法的執行是多執行緒的 StopListening() ,即使呼叫完成後 UnregisterObject(IRegisteredObject) ,方法仍可能被呼叫一段時間。