WCF - 套接字连接已中止

3
当我在远程主机上使用TCP绑定运行WCF服务时,我遇到了以下异常。然而basichttpbinding可以工作。
同时,当我在同一台机器上托管它时,它也可以正常工作。
另外,使用测试客户端和连接到远程机器时,TCP也可以正常工作。
你认为我为什么会遇到以下异常?有什么解决方法?
Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at IService1.GetSectionEntity(String id)
   at Service1Client.GetSectionEntity(String id) in C:\src\Service1.cs:line 2318
   at GetSectionSync(Id sectionId, Boolean loadFromDbIfNotInCache) 
2011-02-22 10:41:13,888|WARN | HttpHandler|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:00:29.9870000'.
2011-02-22 10:41:13,891|ERROR|HttpHandler|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:00:29.9870000'.
System.ServiceModel.CommunicationException: 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:00:29.9870000'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
   --- End of inner exception stack trace ---

只是猜测,但如果您的服务在本地机器上工作并且使用不同的绑定,那么远程机器可能已经在使用该端口?我相信默认值为888。 - W.Jackson
我可以通过WCF测试客户端访问远程机器并且它可以工作。而且这个地址也可以工作:http://remote:8080/service1,我可以浏览到这个地址。但是我无法使用它... - DarthVader
@DarthVader - 你最终确定了根本原因吗? - RQDQ
@RQDQ的配置已经完成。 - DarthVader
1
@DarthVader,你在配置中改了什么来修复它? - Jeff LaFay
1个回答

2

我很感谢这些要点,但我也想知道根本原因是什么。这是我在当时有限的信息条件下能够给出的最佳建议。 - RQDQ

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接