Share via


IHttpServer Interface

 

Represents the processing context for global-level operations.

Syntax

class IHttpServer  

Methods

The following table lists the methods exposed by the IHttpServer interface.

Name Description
AddFragmentToCache Adds an HTTP_DATA_CHUNK structure to the cache.
AssociateWithThreadPool Associates an asynchronous completion operation with the thread pool.
DecrementThreadCount Decrements the thread count for the thread pool.
DispenseContainer Returns a context container that may be dispensed.
DoCacheOperation Performs a specific cache operation.
FlushKernelCache Flushes the kernel cache for a specific Uniform Resource Identifier (URI).
GetAppPoolName Retrieves the name of the application pool for the current request.
GetConfigObject Retrieves the configuration object for the current context.
GetFileInfo Returns an IHttpFileInfo interface for a specific file path.
GetManagedType Retrieves the managed type for a specific site and Uniform Resource Identifier (URI).
GetPerfCounterInfo Retrieves an IHttpPerfCounterInfo interface.
GetProtocolManagerCustomInterface Retrieves a custom interface for a protocol manager.
GetTraceContext Retrieves an IHttpTraceContext interface.
GetWorkerProcessSettings Retrieves an IWpfSettings interface.
IncrementThreadCount Increments the thread count for the thread pool.
IsCommandLineLaunch Tests whether the worker process was launched from the command line.
NotifyConfigurationChange Triggers a notification that a configuration path has changed.
NotifyCustomNotification Raises a custom global-level notification.
NotifyFileChange Triggers a notification that a file has changed.
ReadFragmentFromCache Retrieves a specific fragment from the cache.
RecycleApplication Recycles an application.
RecycleProcess Recycles the worker process that is handling the current request.
RegisterFileChangeMonitor Registers file-change notification for a particular directory.
RemoveFragmentFromCache Removes a specific fragment from the cache.
ReportUnhealthy Reports the worker process as unhealthy.
SatisfiesPrecondition Determines whether a specific precondition has been met for the current request.

Derived Classes

Name Description
IHttpServer2 Represents the processing context for global-level operations, and enables retrieving configuration files, extended interfaces, metadata, tokens, and the worker process framework.

Remarks

The IHttpServer interface represents the main programmatic interface for HTTP modules to access information about the current global-level context. This interface retrieves several additional interfaces that you can use when you write HTTP modules. For example, the GetFileInfo and GetPerfCounterInfo methods retrieve, respectively, the IHttpFileInfo and IHttpPerfCounterInfo interfaces for the global context. These interfaces allow developers to retrieve a file interface for a specific file, or an interface for the performance counters.

IIS 7 allows developers to restart an application, restart a worker process, or report the current context as unhealthy. This functionality is exposed, respectively, through the RecycleApplication, RecycleProcess, and ReportUnhealthy methods.

The IHttpServer interface provides several methods that allow developers to manipulate the IIS cache. These methods are the AddFragmentToCache, DoCacheOperation, FlushKernelCache, ReadFragmentFromCache, and RemoveFragmentFromCache methods.

Note

Http.sys manages and owns the fragment cache. At any time, Http.sys may override or delete information that you directed to be stored. There is currently no way to lock information in the fragment cache as nonvolatile information.

Developers can use the GetAppPoolName, GetManagedType, GetWorkerProcessSettings, and SatisfiesPrecondition methods to retrieve information from the configuration settings for the current context.

The IHttpServer interface also provides the NotifyConfigurationChange, NotifyFileChange, NotifyCustomNotification methods, which allow developers to raise notifications for configuration changes, file changes, or a custom notification condition, respectively.

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016 Technical Preview
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- IIS Express 7.5, IIS Express 8.0, IIS Express 10.0
Header Httpserv.h

See Also

Web Server Core Interfaces