我在我的項目中使用WCF從服務器(訪問數據庫)和客戶端傳輸數據,該客戶端在屏幕上繪製數據。大量數據通過WCF傳輸
傳輸的數據量非常大,所以我想知道哪個是最好的方式。
現在,我能夠查詢少量數據,大約3600個對象(時間戳和雙精度值)。但是,如果此數字增加到大約86400個對象,則會發生服務函數調用中的錯誤。
我的服務端和客戶端的聲明如下:
服務器:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata/>
<dataContractSerializer maxItemsInObjectGraph="6553600"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="serviceName">
<endpoint binding="netTcpBinding" contract="interfaceName">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:5050/msservice"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
客戶:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IService" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:02:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxConnections="10" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
<message clientCredentialType="Windows"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:5050/msservice" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IService" contract="IService" name="NetTcpBinding_IService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</client>
</system.serviceModel>
你看過流媒體嗎? [大數據和流式傳輸](http://msdn.microsoft.com/zh-cn/library/ms733742.aspx) – Tim 2012-04-18 00:58:20