【发布时间】:2014-01-29 13:42:12
【问题描述】:
我正在新研究 Web 服务 WCF,并且我被分配了在大数据情况下测试 Web 服务的责任。所以,通过Entity Object,我携带了大约。 16000+ 条记录,但我的代码抛出异常,如:
套接字连接被中止。这可能是由于处理您的消息时出错或远程主机超出接收超时,或者是潜在的网络资源问题引起的。本地套接字超时为 '00:24:59.9989991'。
虽然我在 App.Config and Web.Config 文件中将 Socket Timeout 从 5 增加到 25,但仍然存在相同的错误。这让我相信一定有大数据问题。
App.Config
<bindings>
<netTcpBinding>
<binding name="tcpBinding"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferPoolSize="2147483647"
receiveTimeout="00:06:00" sendTimeout="00:06:00" >
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
<security mode="None" />
</binding>
</netTcpBinding>
<webHttpBinding>
<binding name="RESTBinding"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferPoolSize="2147483647"
receiveTimeout="00:06:00" sendTimeout="00:06:00" >
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
cs 文件
userObject = client.GetAll().ToList();
而且,GetALL() 有这样的定义:
var result = (from user in entity.User select user).ToList();
return result;
而且,上面的代码返回了 16000+ 条记录,但是由于哪个 webservice 给出了异常。 我从网上对该主题进行了研发,但没有找到任何有用的答案,谁能建议我该怎么做。
【问题讨论】:
-
Local socket timeout was '00:24:59.9989991'.25 好像不够长。 -
那么双重
ToList()可能也无济于事......
标签: c# wcf web-services sockets