配置属性

HTTP 服务器版本 2.0 API 允许应用程序手动配置请求队列、服务器会话和 URL 组。 服务器会话是顶级对象,其中包含适用于在它们下创建的所有 URL 组的配置信息。 应用程序创建包含一个或多个 URL 组的服务器会话,然后将该 URL 组与请求队列相关联。

有关 HTTP 服务器版本 2.0 API 中的特定配置对象的详细信息,请参阅:

配置对象的属性是使用 HttpSetServerSessionPropertyHttpSetUrlGroupPropertyHttpSetRequestQueueProperty 设置的,如下图所示。 请求队列和 URL 组之间的关联可以按需更改,而服务器会话和 URL 组之间的关联则不能更改。 URL 组必须与请求队列相关联才能接收请求。

配置对象的属性

下表列出了可在每个配置对象上设置的属性。 通常,如果应用程序未设置任何属性配置,则应用 HTTP 服务器 API 默认配置。 应用程序在服务器会话上设置的配置属性将替代 HTTP 服务器 API 范围的配置。 在 URL 组上设置的配置将替代服务器会话配置,请求队列配置将替代 HTTP 服务器 API 默认配置。

Configuration 对象 属性
服务器会话 HttpServerStateProperty HttpServerLoggingProperty HttpServerQosProperty HttpServerTimeoutsProperty HttpServerAuthenticationProperty
URL 组 HttpServerStateProperty HttpServerAuthenticationProperty HttpServerLoggingProperty HttpServerQosProperty HttpServerBindingProperty HttpServerTimeoutsProperty
请求队列 HttpServerStateProperty HttpServerQueueLengthProperty HttpServer503VerbosityProperty

 

服务器会话属性在 HTTP_SERVER_PROPERTY 枚举中定义。 下表列出了为每个属性类型设置的属性结构,以及当应用程序未设置这些属性时 HTTP 服务器 API 默认值。

属性 结构 HTTP 服务器 API 默认值
HttpServerAuthenticatonProperty HTTP_SERVER_AUTHENTICATION_INFO 无身份验证
HttpServerLoggingProperty HTTP_LOGGING_INFO 无日志记录
HttpServerQosProperty-HttpQosSettingTypeConnectionLimit> HTTP_CONNECTION_LIMIT_INFO 无限制
HttpServerTimeoutsProperty HTTP_TIMEOUT_LIMIT_INFO 120 秒
HttpServerQosProperty-HttpQosSettingTypeBandwidth> HTTP_BANDWIDTH_LIMIT_INFO 无限制
HttpServerQueueLengthProperty ULONG 1000
HttpServerStateProperty HTTP_STATE_INFO Enabled
HttpServer503VerbosityProperty HTTP_503_RESPONSE_VERBOSITY HttpResponseVerbosityBasic
HttpServerBindingProperty HTTP_BINDING_INFO

 

下表列出了 HTTP 服务器 API 配置的最小值和最大值。

属性 HTTP 服务器 API 最大值和最小值
HttpServerQosProperty-HttpQosSettingTypeBandwidth> Min = MIN_ALLOWED_BANDWIDTH_THROTTLING_RATE Max = none
HttpServerQueueLengthProperty Min = 0xA Max = 0xFFFF