【发布时间】:2010-03-10 14:17:15
【问题描述】:
我们收到此错误:
System.ServiceModel.ServerTooBusyException: 创建可靠的请求 会话已被 RM 拒绝 目的地。服务器 'net.tcp://localhost:50000/' 也是 忙于处理此请求。尝试 稍后再试。该频道无法 打开了。
据我了解,我需要在 ReliableSession 绑定中增加 MaxPendingChannels 的值。
但是我们在这样的代码中配置 WCF:
serviceHost = new ServiceHost(typeof(MyServiceClass));
ServiceEndpoint endPoint = serviceHost.AddServiceEndpoint(
typeof(IMyService),
new NetTcpBinding(SecurityMode.None, true),
endPointAddress);
那么如何以编程方式设置 ReliableSession.MaxPendingChannels? (我能找到的所有示例都使用配置文件)
在此web page 上搜索 MaxPendingChannels 以获得一个选项,但它似乎过于复杂。
【问题讨论】:
标签: .net wcf configuration nettcpbinding