我目前正在尝试使用具有 SilverLight 4.0 的 PollingDuplex 绑定来构建双工 WCF 服务。
我的服务每 1 秒为每个连接的客户端调用几个回调方法。但是,在 2 个客户端连接后,新客户端得到“位于...的服务太忙”
我的服务使用这种行为:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Multiple)]
WCF 绑定配置:
<pollingDuplexHttpBinding>
<binding name="" maxOutputDelay="00:00:01" serverPollTimeout="00:05:00"
inactivityTimeout="02:00:00" duplexMode="MultipleMessagesPerPoll"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</pollingDuplexHttpBinding>
服务行为:
<behavior name="Push">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="2147483647"
maxConcurrentInstances="2147483647"
maxConcurrentSessions="2147483647"/>
</behavior>
服务定义:
<services>
<service name="PushService" behaviorConfiguration="Push">
<endpoint address="" binding="pollingDuplexHttpBinding"
contract="PushService"/>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
有什么帮助吗?这个例外让我抓狂!