最近在项目中采用 Windows service 作为WCF services的宿主, 在服务和客户端的调用上没有发生如何的异常和错误,但是经常发生下述错误:
“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 '10675199.02:48:05.4775807'”
下面是一个解决方案:当使用WCF 服务使用 netTcpBinding 时,需要在客户端代理调用方法close()关闭代理,将服务的实例放回到池中。
WCF服务使用WSHttp或者BasicHttp的时候没有这个问题。
本文介绍了一个常见的WCF服务问题:使用netTcpBinding时发生的连接异常及超时错误。文中提供了具体的解决方案,即确保客户端代理调用方法close()来释放资源。
6412

被折叠的 条评论
为什么被折叠?



