0

SilverLight5アプリケーションと.NET4サーバー間でWCFストリーミングを使用してライブデータをストリーミングしようとしています。私が必要としているのは、サーバーとクライアント間の最小の待ち時間です。ただし、WCFはデータを送信する前にデータをバッファリングしているようです。私はこのサイトの例に従っています:http://blogs.msdn.com/b/carlosfigueira/archive/2010/07/08/using-transfermode-streamedresponse-to-download-files-in-silverlight-4。 aspx。カスタムストリームを実装しましたが、たとえば1秒間に小さなチャンク(400バイト未満)を10回読み取ることがわかりますが、ネットワーク上ではサーバーは10秒ごとにデータを返します(32776バイトを返します-これは私が取得する数ですWireshark)。サーバーが準備ができたらすぐにデータを返すか、少なくともバッファを512バイトなどの非常に小さい値に設定する必要があります。

クライアントとサーバーの構成を変更しようとしましたが、うまくいきませんでした。私の構成は次のようになります。

クライアント

<client>
    <endpoint address=""
          binding="customBinding" bindingConfiguration="CustomBinding_IWcfDownloadService_StreamedResponse"
          contract="IWcfDownloadService" name="CustomBinding_IWcfDownloadService_StreamedResponse" />
</client>

<bindings>
  <customBinding>
    <binding name="CustomBinding_IWcfDownloadService_StreamedResponse">
      <binaryMessageEncoding />
      <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="StreamedResponse" />
    </binding>
  </customBinding>
</bindings>

サーバ

<services>
  <service name="WcfDownloadService">
    <endpoint address="" binding="customBinding" bindingConfiguration="customBinding0" contract="IWcfDownloadService" />        
  </service>
</service>

<bindings>
  <customBinding>
    <binding name="customBinding0">
      <binaryMessageEncoding />
      <httpTransport transferMode="StreamedResponse" />          
    </binding>
  </customBinding>
</bindings>
4

0 に答える 0