如果我不关闭Web服务连接,这会释放连接吗?

时间:2017-03-15 15:13:47

标签: c# web-services wcf

如果我在服务器上创建Web服务,例如ASMX或WCF服务,并通过客户端连接到它。

如果我没有明确告诉客户端关闭连接,或者即使在客户端关闭后它仍然保持打开状态,Connection会关闭(返回池)吗?

1 个答案:

答案 0 :(得分:0)

将根据默认超时值或您在web.config文件中声明的内容自动关闭连接。

默认值为 1分钟

<configuration>  
   <system.serviceModel>  
      <bindings>  
         <wsHttpBinding>  
            <binding openTimeout="00:10:00"   
                     closeTimeout="00:10:00"   
                     sendTimeout="00:10:00"   
                     receiveTimeout="00:10:00">  
            </binding>  
         </wsHttpBinding>  
      </bindings>  
  </system.serviceModel>  
相关问题