尝试连接到远程服务器的客户端提供以下异常:
System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://10.7.11.14:18297/zetec/Service/SchedulerService/Scheduler. The connection attempt lasted for a time span of 00:00:21.0042014. TCP error code 10060: A connection attempt Failed because the connected party did not properly respond after a period of time,or established connection Failed because connected host has Failed to respond 10.7.11.14:18297. —> System.Net.Sockets.SocketException: A connection attempt Failed because the connected party did not properly respond after a period of time,or established connection Failed because connected host has Failed to respond 10.7.11.14:18297
该服务配置如下:
<system.serviceModel> <services> <service name="SchedulerService" behaviorConfiguration="SchedulerServiceBehavior"> <host> <baseAddresses> <add baseAddress="net.tcp://localhost/zetec/Service/SchedulerService"/> </baseAddresses> </host> <endpoint address="net.tcp://localhost:18297/zetec/Service/SchedulerService/Scheduler" binding="netTcpBinding" bindingConfiguration = "ConfigBindingNetTcp" contract="IScheduler" /> <endpoint address="net.tcp://localhost:18297/zetec/Service/SchedulerService/Scheduler" binding="netTcpBinding" bindingConfiguration = "ConfigBindingNetTcp" contract="IProcessingNodeControl" /> </service> </services> <bindings> <netTcpBinding> <binding name = "ConfigBindingNetTcp" portSharingEnabled="True"> <security mode="None"/> </binding> </netTcpBinding > </bindings> <behaviors> <serviceBehaviors> <behavior name="SchedulerServiceBehavior"> <serviceDebug includeExceptionDetailInFaults="true" /> <serviceThrottling maxConcurrentSessions="100"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
客户端连接如下:
String endPoint = "net.tcp://" + GetIPV4Address(m_SchedulerHostAddress) + ":" + m_SchedulerHostPort.ToString(CultureInfo.InvariantCulture) + "/zetec/Service/SchedulerService/Scheduler"; NetTcpBinding binding = new NetTcpBinding(); binding.Security.Mode = SecurityMode.None; m_Channel = new DuplexChannelFactory<IProcessingNodeControl>(this,binding,endPoint); m_IProcessingNodeControl = m_Channel.CreateChannel();
我已经检查过我的防火墙十几次了,但我想我可能会遗漏一些东西.尝试禁用Windows防火墙.我尝试将localhost更改为我的ipv4地址以尝试远离ipv6,我尝试删除任何反ipv6代码.
不知道它是否意味着什么,但是:
Microsoft Telnet> open 10.7.11.14 18297
Connecting To 10.7.11.14…Could not open connection to the host,on port 18297:
Connect Failed
遗憾的是,telnet测试似乎并不重要.当服务运行时,我已成功从localhost和远程计算机连接到我的服务端口,但我的客户端无法从远程计算机工作.
看起来并不总能保证连接到localhost.桌面(win7 / 32)工作,笔记本电脑(win7 / 64)不起作用.其他win7 / 64盒子确实有效.也许是因为笔记本电脑上有多个网卡?也没有解释在测试人员系统上连接的失败.
我设置了两台完全禁用IPv6的win7机器(使用0xffffffff,如http://support.microsoft.com/kb/929852所示).没有帮助.