TCP 错误代码 10061:无法连接到 net.tcp://.连接尝试持续了 00:00:01.0156241 的时间



我在服务器中安装了Windows服务(IP:10.60.8.27,端口7002(。尝试从另一台服务器 (10.60.8.28( 中承载的 WCF 服务进行连接时,将发生以下错误。此错误偶尔会发生。当我重新启动Windows服务时,它运行良好。如何解决此问题?我的服务器是(Windows Server 2012 R2(。

错误是:

Could not connect to net.tcp://10.60.8.27:7002/MyService. The connection attempt lasted for a time span of 00:00:01.0156241. TCP error code 10061: No connection could be made because the target machine actively refused it 10.60.8.27:7002. 

我对你的问题有点困惑,没有完全理解你的情况。
在我看来,当服务器使用证书保护通信时,客户端通常会在添加服务引用时生成DNS身份以验证服务器身份。这可能会导致上述错误。

<client>
<endpoint address="net.tcp://vabqia969vm:21011/" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IService1" contract="ServiceReference1.IService1"
name="NetTcpBinding_IService1">
<identity>
<dns value="vabqia969VM" />
</identity>
</endpoint>
</client>

DNS 标记允许客户端在服务器使用证书保护通信时验证服务器身份。
https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/service-identity-and-authentication
此外,我们也不能排除机器的性能。如果瞬间客户端对服务器的请求量激增,基本上存在大量请求超时。
无论如何,请尝试一下并给我反馈。

相关内容

最新更新