【发布时间】:2011-06-12 15:17:10
【问题描述】:
我有一个调用 WCF 服务的 asp.net 应用程序。我一直有一段时间的间歇性超时,所以我决定创建一个跟踪日志。超时后,我在日志文件中发现以下消息:
系统达到了为 节流“MaxConcurrentSessions”。 此油门的限制设置为 10。 油门值可以通过 修改属性 'maxConcurrentSessions' 在 serviceThrottle 元素或通过 修改“MaxConcurrentSessions” 行为属性 ServiceThrottlingBehavior。
问题是我每次都关闭客户端连接,所以我不明白为什么并发会话会增加。下面是我打的一个典型电话:
try
{
//create proxy
client = new CAEServiceContractClient();
response = client.GetSecurityRecords(item);
totalRecords = response.TotalRecords;
securityListView.DataSource = response.SecurityItemColl;
securityListView.DataBind();
// Always close the client.
client.Close();
success = true;
}
finally
{
if (!success)
{
client.Abort();
}
}
所以我的问题是,为什么在我执行 client.Close() 后会话没有被破坏?
TIA。
【问题讨论】:
-
您使用什么出价方式?发生错误时有多少客户访问您的网站?
-
@Ladislav 我明天会检查,但我很确定它是 wsHttpBinding
-
@Ladislav 我们仍在开发中,所以当错误发生时只有我访问该服务。
-
如果您的客户关闭不起作用,它可能很容易重现。在单个会话中调用您的服务 10 次。
标签: wcf timeout asp.net-2.0