Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF PollingDuplex具有高回调调用导致新服务订阅的服务太忙异常_C#_.net_Wcf_Silverlight 4.0_Pollingduplexhttpbinding - Fatal编程技术网

C# WCF PollingDuplex具有高回调调用导致新服务订阅的服务太忙异常

C# WCF PollingDuplex具有高回调调用导致新服务订阅的服务太忙异常,c#,.net,wcf,silverlight-4.0,pollingduplexhttpbinding,C#,.net,Wcf,Silverlight 4.0,Pollingduplexhttpbinding,我目前正在尝试使用SilverLight 4.0的PollingDuplex绑定构建双工WCF服务 我的服务每1秒为每个连接的客户端调用几个回调方法。 然而,在2个客户端连接后,新客户端得到“位于…的服务太忙” 我的服务使用以下行为: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)] <behavior n

我目前正在尝试使用SilverLight 4.0的PollingDuplex绑定构建双工WCF服务

我的服务每1秒为每个连接的客户端调用几个回调方法。 然而,在2个客户端连接后,新客户端得到“位于…的服务太忙”

我的服务使用以下行为:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, 
    ConcurrencyMode = ConcurrencyMode.Multiple)]
<behavior name="Push">
  <serviceMetadata httpGetEnabled="true"/>
  <serviceDebug includeExceptionDetailInFaults="true"/>
  <serviceThrottling maxConcurrentCalls="2147483647"
    maxConcurrentInstances="2147483647" 
    maxConcurrentSessions="2147483647"/>
</behavior>
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>

服务行为:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, 
    ConcurrencyMode = ConcurrencyMode.Multiple)]
<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>


有什么帮助吗?这个例外让我发疯

我认为问题可能与System.Net中的“maxconnection”默认值2有关。 您是否可以尝试在服务和客户端配置中添加以下配置,并检查它是否改善了结果,

上面的配置适用于客户端应用程序,但请记住PollingDuplex是一个双工通道,在该通道中,服务充当回拨操作的客户端

请查找文龙的美丽博客,这解释了为什么需要上述配置,

我认为问题可能与System.Net中的“maxconnection”默认值2有关。 您是否可以尝试在服务和客户端配置中添加以下配置,并检查它是否改善了结果,

上面的配置适用于客户端应用程序,但请记住PollingDuplex是一个双工通道,在该通道中,服务充当回拨操作的客户端

请查找文龙的美丽博客,这解释了为什么需要上述配置,

我注意到我的PollingDuplex软件在使用一个Internet Explorer时最多只能有10个客户端。Windows 2008 Server R2计算机和Web.config具有许多设置时,仍然存在限制:

对于绑定: binding name=“pollingDuplexBinding”maxConnections=“100”

对于服务行为: serviceThrottling maxConcurrentCalls=“1000”maxConcurrentInstances=“1000”maxConcurrentSessions=“1000”

用于轮询双工 maxPendingSessions=“2147483647”maxPendingMessagesPerSession=“2147483647”

但当我尝试与不同的客户合作时:

  • 服务器上IE上的6个客户端
  • IE上的6个客户端位于不同的客户端计算机上
  • 此客户端计算机上FireFox上的4个客户端

它成功了。因此,对于相同的客户端连接有一定的限制。

我注意到我的PollingDuplex软件在使用一个Internet Explorer时限制了10个客户端。Windows 2008 Server R2计算机和Web.config具有许多设置时,仍然存在限制:

对于绑定: binding name=“pollingDuplexBinding”maxConnections=“100”

对于服务行为: serviceThrottling maxConcurrentCalls=“1000”maxConcurrentInstances=“1000”maxConcurrentSessions=“1000”

用于轮询双工 maxPendingSessions=“2147483647”maxPendingMessagesPerSession=“2147483647”

但当我尝试与不同的客户合作时:

  • 服务器上IE上的6个客户端
  • IE上的6个客户端位于不同的客户端计算机上
  • 此客户端计算机上FireFox上的4个客户端
它成功了。因此,对于相同的客户端连接存在某种限制