1.服务端,使用wcf.协议使用net.tcp,然后安装为window 服务;
2.客户端,使用wpf,引用服务端的元数据,传输文件;(实际上就是一个winform程序,供用户选择上传的文件);
问题:
1.将服务安装到服务器上;
2.在任意一台测试机上(测试机和服务器在一个局域网内),打开wpf,上传几十G,都没有问题,速度还很快;
但是 如果在外网上传(比如在家里打开wpf上传),总是报timeout错误.
有人遇到这个问题吗?
我哪里使用有错误吗?
8 个解决方案
#1
这个是wpf中的配置:
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_Message_UserName" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
portSharingEnabled="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</netTcpBinding>
</bindings>
#2
#3
超了10分钟了?
#4
---------------------------
---------------------------
Error!Error: . One or more errors occurred. . The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:09:59.8439997'. . An existing connection was forcibly closed by the remote host
---------------------------
OK
---------------------------
抱着个错误
#5
但是实际时间,没有到10分钟.
如果调了receiveTimeout为"02:00:00",inactivityTimeout="02:00:00"
报的错就是 timeout was '01:59:59.8439997'
#6
= = 本地和网络时间不一致?
#7
说的对,我试一下,多谢提醒
#8
我服务器时间是canada时区,外网的时区是北京时间.
请问有什么办法,让服务端计算时间的时候,都是用utc-0时间呢?有办法吗?
#1
这个是wpf中的配置:
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_Message_UserName" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
portSharingEnabled="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</netTcpBinding>
</bindings>
#2
#3
超了10分钟了?
#4
---------------------------
---------------------------
Error!Error: . One or more errors occurred. . The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:09:59.8439997'. . An existing connection was forcibly closed by the remote host
---------------------------
OK
---------------------------
抱着个错误
#5
但是实际时间,没有到10分钟.
如果调了receiveTimeout为"02:00:00",inactivityTimeout="02:00:00"
报的错就是 timeout was '01:59:59.8439997'
#6
= = 本地和网络时间不一致?
#7
说的对,我试一下,多谢提醒
#8
我服务器时间是canada时区,外网的时区是北京时间.
请问有什么办法,让服务端计算时间的时候,都是用utc-0时间呢?有办法吗?