【发布时间】:2014-05-23 16:37:02
【问题描述】:
我正在尝试在 Windows 7x64 和 Studio 2012 Professional 上使用 WCF 建立点对点连接。当笔记本电脑使用无线时,WPF 停止工作。
我的电脑通过以太网电缆连接到网络交换机,而我的笔记本电脑使用有线连接到同一个网络,WCF 可以工作。
但是,
当我的计算机通过以太网电缆连接到网络交换机并且我的笔记本电脑使用 WIRELESS 连接到同一网络时,WCF 不起作用。
我确实更新了有线和无线之间的端口号。
非常感谢任何帮助。
错误如下:
Error()
{
System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://100.100.1.90:9000/test_robot_client. The connection attempt lasted for a time span of 00:00:01.0430000. TCP error code 10061: No connection could be made because the target machine actively refused it 100.100.1.90:9000. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 100.100.1.90:9000
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
}
我在尝试发送 WCF 命令时使用 Catch(Exception ex) 看到上述错误。
谢谢!
【问题讨论】:
-
WCF 服务是否托管在 IIS 中?
-
它说目标机器主动拒绝了它,所以我会检查服务器上的防火墙。甚至尝试禁用服务器和客户端上的防火墙,以确保没有人拒绝网络通信。
-
WCF 服务不是 IIS 中的宿主。它只是tcp。我试图关闭服务器和客户端的防火墙。我什至关闭了 Avast。问题依然存在。知道接下来会发生什么吗?
-
这很奇怪....如果我要在笔记本电脑上运行服务器,在我的电脑上运行客户端,那么我可以在笔记本电脑处于无线状态时建立 WCP 连接。
-
我得到了修复。我在某处读到,有人提到要打开端口 808。所以我这样做了,它有效!感谢大家的帮助!!