クライアントが通知を受信するように登録する二重対応サービスがあります。同じ AppPool に、クライアントがサーバーと通信するために使用する別の通常の Web サービスがあります。この Web サービスに何かを送信すると、接続されているすべてのクライアントに通知がトリガーされます。12、13、またはそれ以上のクライアントが接続されるまで、すべてが正常に機能します。次に、二重チャネルでのサブスクライブ/受信と、他のサービスへの送信の両方が非常に遅くなります。asp.net の互換性を無効にしましたが、Web サービス プロジェクトに global.asax ファイルがありません。これにより、セッションがトリガーされて速度が低下する可能性があります。
私の Web サービスは、Windows Server 2008 上の IIS7 でホストされています。私のクライアントは SL4 を実行していますが、Web サービスは .NET 3.5 でホストされていることに注意してください。
ここに、私の web.config ファイルからの抜粋をいくつか示します。
<bindingExtensions>
<add name="pollingDuplexHttpBinding" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,System.ServiceModel.PollingDuplex, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </bindingExtensions>
<pollingDuplexHttpBinding>
<binding name="pollingDuplexHttpBindingConfig"/>
</pollingDuplexHttpBinding>
<service name="WcfDuplexService.NotificationService"
behaviorConfiguration="ServiceBehavior">
<!-- Service Endpoints -->
<endpoint address=""
binding="pollingDuplexHttpBinding"
bindingConfiguration="pollingDuplexHttpBindingConfig"
contract="WcfDuplexService.INotificationService"
behaviorConfiguration="ServiceFullEndpointBehavior">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
<!-- Message Service -->
<service name="WcfDuplexService.MessageService"
behaviorConfiguration="ServiceBehavior">
<endpoint binding="customBinding"
bindingNamespace="http://csintra.net/MessageService"
contract="WcfDuplexService.IMessageService"
bindingConfiguration="binaryHttpBinding"
behaviorConfiguration="ServiceFullEndpointBehavior">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceThrottling maxConcurrentCalls="1024" maxConcurrentSessions="1024" maxConcurrentInstances="1024" />
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
前もって感謝します。