最近在项目中采用 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的时候没有这个问题。

相关文章:

  • 2021-06-23
  • 2021-05-18
  • 2022-12-23
  • 2021-12-26
  • 2021-08-20
  • 2021-09-13
猜你喜欢
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-12-09
  • 2021-07-13
  • 2021-04-28
相关资源
相似解决方案