我们有一个WCF服务,它有多个客户端来安排客户端之间的操作。它在XP上效果很好。转到win7,我只能将客户端连接到同一台机器上的服务器。在这一点上,我认为这与IPv6有关,但我很难理解如何继续。WCF上的WCF双工net.tcp问题
客户端试图连接到远程服务器提供了以下异常:
System.ServiceModel.EndpointNotFoundException:无法连接到的net.tcp://10.7.11.14:18297/zetec /服务/ SchedulerService /调度。连接尝试持续时间为00:00:21.0042014。 TCP错误代码10060:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而导致连接失败10.7.11.14:18297。 ---> System.Net.Sockets.SocketException:连接尝试失败,因为连接方在一段时间后没有正确响应,或由于连接的主机未能响应而建立连接失败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防火墙。我尝试更改本地主机到我的ipv4地址,以尽量远离ipv6,我试图删除任何反ipv6代码。
不知道这意味着什么,但:
微软的Telnet>打开10.7.11.14 18297
连接为10.7.11.14 ......无法打开连接到主机,端口18297 : 连接失败
不幸的是,telnet测试似乎不是关键。服务运行时,我已成功地从本地主机和远程计算机连接到服务的端口,但我的客户端无法从远程计算机上运行。
看起来像连接到本地主机并不总能得到保证。桌面(win7/32)正常工作,笔记本电脑(win7/64)不起作用。其他的win7/64盒子确实可以工作。也许是由于笔记本电脑上的多个网卡?也没有解释测试人员系统连接失败。
我设置了两台IPv6完全禁用的win7机器(使用0xffffffff,如http://support.microsoft.com/kb/929852)。没有帮助。
只是有一点额头拍打的时刻。 IScheduler合同的使用者在机器上工作时没有问题。只有未能连接的IProcessingNodeControl客户端。他们使用几乎相同的代码进行连接。现在我想他们应该有不同的相对网址,但这似乎没有帮助。 – Thomas 2010-03-15 17:12:32
好吧,我可以看到我的客户端失败,失败,无法连接,然后关闭Windows防火墙并成功。我的托管应用程序已经有一个例外,除了我还需要什么? – Thomas 2010-03-15 23:04:38
Net.TCP当然! – Thomas 2010-03-15 23:10:54